Wednesday, March 11, 2009

Logic Design

The Binary System

Binary numbers are used to represent all information in the digital world. They’re similar to our decimal system, which uses the digits 0 to 9, except binary uses only 0 and 1.

Binary is handy because now we can easily use something physical to represent numbers. For instance we could use a laser. When it's on you know it means ‘1’ and when it’s off you know it means ‘0’.

When we write numbers in decimal, it's the position or place of the number that tells us what its real value is. With 246 for example, the 6 at the end is six ones, the 4 in the middle is four tens and the 2 is two hundreds. Each place or position is 10 times greater than the previous position.

The binary number system also uses place to give value, but as we have only 2 numbers to work with each place or position is only 2 times greater than the one before.

In binary code:

  • Decimal number 0 is binary 0
  • Decimal number 1 is binary 1
Binary Arithmetic

Arithmetic in binary is much like arithmetic in other numeral systems. Addition, subtraction, multiplication, and division can be performed on binary numerals.

Addition


The circuit diagram for a binary half adder, which adds two bits together, producing sum and carry bits.

The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:

0 + 0 → 0
0 + 1 → 1
1 + 0 → 1
1 + 1 → 0, carry 1 (since 1 + 1 = 0 + 1 × 10 in binary)

Adding two "1" digits produces a digit "0", while 1 will have to be added to the next column. This is similar to what happens in decimal when certain single-digit numbers are added together; if the result equals or exceeds the value of the radix (10), the digit to the left is incremented:

5 + 5 → 0, carry 1 (since 5 + 5 = 0 + 1 × 10)
7 + 9 → 6, carry 1 (since 7 + 9 = 6 + 1 × 10)

This is known as carrying. When the result of an addition exceeds the value of a digit, the procedure is to "carry" the excess amount divided by the radix (that is, 10/10) to the left, adding it to the next positional value. This is correct since the next position has a weight that is higher by a factor equal to the radix. Carrying works the same way in binary:

    1 1 1 1 1  (carried digits)
0 1 1 0 1
+ 1 0 1 1 1
-------------

Subtraction

Subtraction works in much the same way:

0 − 0 → 0
0 − 1 → 1, borrow 1
1 − 0 → 1
1 − 1 → 0

Subtracting a "1" digit from a "0" digit produces the digit "1", while 1 will have to be subtracted from the next column. This is known as borrowing. The principle is the same as for carrying. When the result of a subtraction is less than 0, the least possible value of a digit, the procedure is to "borrow" the deficit divided by the radix (that is, 10/10) from the left, subtracting it from the next positional value.

* * * * (starred columns are borrowed from)
1 1 0 1 1 1 0
− 1 0 1 1 1
----------------
= 1 0 1 0 1 1 1

Subtracting a positive number is equivalent to adding a negative number of equal absolute value; computers typically use two's complement notation to represent negative values. This notation eliminates the need for a separate "subtract" operation. Using two's complement notation subtraction can be summarized by the following formula:


= 1 0 0 1 0 0

Multiplication

Multiplication in binary is similar to its decimal counterpart. Two numbers A and B can be multiplied by partial products: for each digit in B, the product of that digit in A is calculated and written on a new line, shifted leftward so that its rightmost digit lines up with the digit in B that was used. The sum of all these partial products gives the final result.

Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication:

  • If the digit in B is 0, the partial product is also 0
  • If the digit in B is 1, the partial product is equal to A

For example, the binary numbers 1011 and 1010 are multiplied as follows:

1 0 1 1 (A)
× 1 0 1 0 (B)
---------
0 0 0 0 ← Corresponds to a zero in B
+ 1 0 1 1 ← Corresponds to a one in B
+ 0 0 0 0
+ 1 0 1 1
---------------
= 1 1 0 1 1 1 0

3 Basic Logical Operation

The AND Gate

The AND gate implements the AND function. With the gate shown to the left, both inputs must have logic 1 signals applied to them in order for the output to be a logic 1. With either input at logic 0, the output will be held to logic 0.


The OR Gate

The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart, allows the output to be true (logic 1) if any one or more of its inputs are true. Verbally, we might say, "If it is raining OR if I turn on the sprinkler, the lawn will be wet." Note that the lawn will still be wet if the sprinkler is on and it is also raining. This is correctly reflected by the basic OR function.


2-input OR gate

The NOT Gate, or Inverter

The inverter is a little different from AND and OR gates in that it always has exactly one input as well as one output. Whatever logical state is applied to the input, the opposite state will appear at the output.

The NOT function, as it is called, is necesasary in many applications and highly useful in others. A practical verbal application might be:

Inverter, or NOT gate
Boolean Algebra

    AND Operations (·)
    0·0 = 0      A·0  = 0
    1·0 = 0 A·1 = A
    0·1 = 0 A·A = A
    1·1 = 1 A·A' = 0
    OR Operations (+)
    0+0 = 0      A+0  = A
    1+0 = 1 A+1 = 1
    0+1 = 1 A+A = A
    1+1 = 1 A+A' = 1
    NOT Operations (')
    0' = 1       A''  = A
    1' = 0
The 2 Input Multiplexer
Two-Input Multiplexer
The multiplexer circuit is typically used to combine two or more
digital signals onto a single line, by placing them there at different
times. Technically, this is known as time-division
multiplexing
.


Demultiplexer
( one output many inputs )
- The opposite of the multiplexer circuit, logically enough, is the
demultiplexer. This circuit takes a single data input and one or
more address inputs, and selects which of multiple outputs will receive
the input signal. The same circuit can also be used as a decoder,
by using the address inputs as a binary number and producing an output
signal on the single output that matches the binary address input. In this
application, the data input line functions as a circuit enabler — if
the circuit is disabled, no output will show activity regardless of the
binary input number.
1-to-2-line decoder/demultiplexer

Computer Architecture

System Software Tools

Editor - makes changes as commanded by user
Assembler - used to write system as well as application program
- translate a program from assembly language source to object code that is very close to machine code
Compiler - translate another p[program from a high - level language to object code
Linkers - application is written in C the other part can be written in assembly
Loader - only an executable file may be loaded into memory before its execution
- loading function is performed by a routine in the OS known as the loader
Debugger - when a program first execute on the the computer, it may not work correctly as expected

Registers

Accumulator (AX register) - is a register in which intermediate arithmetic and logic results are stored. Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory, perhaps only to be read right back again for use in the next operation.

Tuesday, March 10, 2009

Data Communication

2 Standard Wiring
1. 568A (cross over )
*
white green
* green
* white orange
* blue
* orange
* white brown
* brown

2. 568B (straight thru )
*
white orange
* orange
* white green
* blue
* white blue
* green
* white brown
* brown


Cross over cable -
do not used a hub or switch
- attach to RJ45 plug using one standard and the other one second standard


Computer Network Devices

Network switch
- is a computer networking device that connects network segments.
- is a marketing term rather than a technical one
- switches may operate at one or more OSI layers, including physical, datalink, network, or transport (i.e., end-to-end). A device that operates simultaneously at more than one of these layers is called a multilayer switch, although use of the term is diminishing.
Network hub or repeater hub - is a device for connecting multiple twisted pair or fiber optic Ethernet devices together and thus making them act as a single network segment. Hubs work at the physical layer (layer 1) of the OSI model. The device is thus a form of multiport repeater. Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it detects a collision.

Network repeater - connects two segments of your network cable. It retimes and regenerates the signals to proper amplitudes and sends them to the other segments. When talking about, ethernet topology, you are probably talking about using a hub as a repeater. Repeaters require a small amount of time to regenerate the signal. This can cause a propagation delay which can affect network communication when there are several repeaters in a row. Many network architectures limit the number of repeaters that can be used in a row. Repeaters work only at the physical layer of the OSI network model.

Network bridge - reads the outermost section of data on the data packet, to tell where the message is going. It reduces the traffic on other network segments, since it does not send all packets. Bridges can be programmed to reject packets from particular networks. Bridging occurs at the data link layer of the OSI model, which means the bridge cannot read IP addresses, but only the outermost hardware address of the packet. In our case the bridge can read the ethernet data which gives the hardware address of the destination address, not the IP address. Bridges forward all broadcast messages. Only a special bridge called a translation bridge will allow two networks of different architectures to be connected. Bridges do not normally allow connection of networks with different architectures. The hardware address is also called the MAC (media access control) address. To determine the network segment a MAC address belongs to, bridges use one of:
  • Transparent Bridging - They build a table of addresses (bridging table) as they receive packets. If the address is not in the bridging table, the packet is forwarded to all segments other than the one it came from. This type of bridge is used on ethernet networks.
  • Source route bridging - The source computer provides path information inside the packet. This is used on Token Ring networks.
Network router - used to route data packets between two networks. It reads the information in each packet to tell where it is going. If it is destined for an immediate network it has access to, it will strip the outer packet, readdress the packet to the proper ethernet address, and transmit it on that network. If it is destined for another network and must be sent to another router, it will re-package the outer packet to be received by the next router and send it to the next router. The section on routing explains the theory behind this and how routing tables are used to help determine packet destinations. Routing occurs at the network layer of the OSI model. They can connect networks with different architectures such as Token Ring and Ethernet. Although they can transform information at the data link level, routers cannot transform information from one data format such as TCP/IP to another such as IPX/SPX. Routers do not send broadcast packets or corrupted packets. If the routing table does not indicate the proper address of a packet, the packet is discarded.

Network brouter - function similar to a bridge for network transport protocols that are not routable, and will function as a router for routable protocols. It functions at the network and data link layers of the OSI network model.

Network operating system (NOS) - is software that controls a network and its message (e.g. packet) traffic and queues, controls access by multiple users to network resources such as files, and provides for certain administrative functions, including security.

Network operating system features may include: