Chapter One COA
Chapter One COA
Chapter One COA
Chapter one
Computer architecture is linked to the art of determining the needs of the user/ system/
technology, and creating logical design and standards based on those requirements.
It is concerned with the structure and behavior of the computer as seen by the user.
It includes the information formats, the instruction set and techniques for addressing memory.
is concerned with the way the hardware computer operate and the way they are connected
together to form the computer system.
The various components are assumed to be in place and the task is to investigate the
organizational structure to verify that the computer parts operation as intended.
Computer Design:
Once the computer specification is formulated, it is the task of the designer to develop hardware
for the system.
It is concerned with the determination of what hardware should be used and how the parts should
be connected.
Digital logic is the representation of signals and sequences of a digital circuit through numbers. It
is the basis for digital computing and provides a fundamental understanding on how circuits and
hardware communicate within a computer.
Digital Computers
Digital computers use the binary number system, which has two digits, 0 and 1
Bits are grouped together as bytes and words to form some type of representation within the
computer.
The hardware of the computer is usually divided into three major parts.
The Central processing Unit (CPU): contains an arithmetic and logic unit for manipulating
data, a number of registers for storing data, and control circuits for fetching and executing
instructions.
The memory of a computer; contains storage for instructions and data, it is called a Random
Access Memory (RAM) the CPU can access any location in memory at random and retrieve the
binary information within a fixed interval of time.
The input and output processor: contains electronic circuit for communication and controlling
the transfer of information between the computer and the outside world.
The input and output device: connected to the computer include keyboards, printers, terminals,
magnetic disk drives and other communication devices.
Logic gates
Flip-flops
Counters,
Registers,
Logic gates
Logic gates are the switches that turn ON or OFF depending on what the user is doing!
Logic gates turn ON when a certain condition is true, and OFF when the condition is false
They check whether or not the information they get follows a certain rule
They either spit out the answer true (ON) or false (OFF)
Remember:
True= ON = 1= High
There are also other logic gates like: NAND, NOR, XOR and XNOR.(derived from three forme)
The picture used to represent logic gates are called logic diagram.
NOT Gate
All it does is taking in an input that is either ON or OFF and spits out the opposite.
Another name for a NOT gate is inverter, because it inverts (makes opposite) the input.
Ā with a
A A’
0 1
1 0
AND
The symbol “ • ” is used for logical multiplication operator
0 1 0
1 0 0
1 1 1
1 = High 0 = Low
OR
0 0 0
0 1 1
1 0 1
1 1 1
1= HIGH 0 = LOW
NAND gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.
The outputs of all NAND gates are true if any of the inputs are false.
0 0 1
0 1 1
1 0 1
1 1 0
1= HIGH 0 = LOW
NOR gate
The outputs of all NOR gates are false if any of the inputs are true.
0 0 1
0 1 0
1 0 0
1 1 0
= HIGH 0 = LOW
XOR and XNOR are useful logic functions. Both have two or more inputs
The output of XOR gate is ON if and only if the two inputs are not the same.
The output of XNOR gate is ON if and only if the two inputs are the same.
NB. For n>2 inputs, the output of the XOR is ON for an odd number of ON inputs.
. For n>2 inputs, the output of the XNOR is ON for an even number of ON inputs.
Output
Diagram for XNOR gate
Input A Input B
A
DiagramBfor XOR gate Output
Input A Input B
0 0 0
A B
0 1 1
0 0 1
1 0 1
0 1 0
1 1 0
1 0 0
1= HIGH 0 = LOW
1 1 1
1= HIGH 0 = LOW
Boolean algebra: is an algebraic system of logic introduced by George Boole in 1854.
It deals with binary variables and logic operations operating on those variables.
Postulate 1:
Postulate 2:
X+0=X
X•1=X
X+Y=Y+X
X•Y=Y•X
x + (y + z) = (x + y) + z
x • (y • z) = (x • y) • z
x • (y + z) = x • y + x • z
x + y • z = (x + y) • ( x + z)
Postulate 6:
x+x=1
x•x=0
Principle of Duality:
The implication of this principle is that, any theorem in Boolean algebra has its dual obtainable
by interchanging “+“with “•” and “0” and “1”.
x+x=x
x•x=x
=x+x x= x • x
=x =x
Theorem 2
X+1=1
X•0=0
=x+1 duality
= (x + 1) • 1 (postulate 2b)
= (x + 1) • (x + x) (postulate 6a)
=1 (postulate 6a)
x+x•y=x
x • (x + y) = x
= x • (y + 1) (postulate 3a)
=x
x=x
x • (x + y) = x • y
x+x•y=x+y
x+xy=x
Prove for c
X (1) = x
x+y = x•y
x•y =x+y
Complement of a
function
The complement of a
function F when
expressed in a truth table is obtained by interchanging 1’s and 0’s in the values of F in the truth
table.
When the function is expressed in algebraic form the complement of the function can be derived
by means of De-Morgan’s Theorem.
(x1+x2+x3+….Xn) = x1’x2’x3’…xn’
(x1x2x3…xn)’ =x1’+x2’+x3’+…+xn’
By changing all OR operation to AND operation and all OR operations and then complementing
each individual letter variable we can derive a simple procedure for obtaining the complement of
an algebraic expression.
NB: The complement expression is obtained by interchanging AND and OR operations and
complementing each individual.
Karnaugh Maps (K-Maps) are a graphical method of visualizing the 0’s and 1’s of a Boolean
function.The map method is known as the Karnaugh map or K-map.
Karnaugh maps can be easier to use than Boolean equation minimization once you get used to it.
The 0’s and the 1’s marked along each row and each column designate the value of the variables.
Each variable under the brackets contain half of the squares in the map where that variable
appears unprimed.
The minterm represent by a square is determined from the binary assignment of the variable
along the left top edges in the map.
Here the min term 5 the three variable maps are 101 of the second column. This minterm
represents a value for the binary variables A, B and C with A and C being unprimed and B being
primed.
A Boolean function represented by a truth table is plotted into the map by inserting 1's into those
squares where the function is 1.
Boolean functions can then be simplified by identifying adjacent squares in the Karnaugh map
that contain a 1.
A square is considered adjacent to another square if it is next to, above, or below it. In addition,
squares at the extreme ends of the same horizontal row are also considered adjacent. The same
applies to the top and bottom squares of a column.
The objective to identify adjacent squares containing 1's and group them together.
some examples of simplification with 3-variable Karnaugh maps. We show how to map the
product terms of the unsimplified logic to the K-map. We illustrate how to identify groups of
adjacent cells which leads to a Sum-of-Products simplification of the digital logic.
Above we, place the 1’s in the K-map for each of the product terms, identify a group of two, then
write a p-term (product term) for the sole group as our simplified result.
Mapping the four product terms above yields a group of four covered by Boolean A’
Mapping the four p-terms yields a group of four, which is covered by one variable C.
After mapping the six p-terms above, identify the upper group of four, pick up the lower two
cells as a group of four by sharing the two with two more from the other group. Covering these
two with a group of four gives a simpler result. Since there are two groups, there will be two p-
terms in the Sum-of-Products result A’+B
The two product terms above form one group of two and simplifies to BC
Mapping the four p-terms yields a single group of four, which is B
Mapping the four p-terms above yields a group of four. Visualize the group of four by rolling up
the ends of the map to form a cylinder, then the cells are adjacent. We normally mark the group
of four as above left. Out of the variables A, B, C, there is a common variable: C’. C’ is a 0 over
all four cells. Final result is C’.
The six cells above from the unsimplified equation can be organized into two groups of four.
These two groups should give us two p-terms in our simplified result of A’ + C’.
We will simplify the logic using a Karnaugh map.
The Boolean equation for the output has four product terms. Map four 1’s corresponding to the
p-terms. Forming groups of cells, we have three groups of two. There will be three p-terms in the
simplified result, one for each group. See “Toxic Waste Incinerator”, Boolean algebra chapter for
a gate diagram of the result, which is reproduced below.
Below we repeat the Boolean algebra simplification of SOP
Below we repeat the Toxic waste incinerator Karnaugh map solution for comparison to the above
Boolean algebra simplification. This case illustrates why the Karnaugh map is widely used for
logic simplification.
The Karnaugh map method looks easier than the previous page of
boolean algebra.
Example: We will simplify the Boolean function. F (A, B, C) = Σ (3, 4, 6, 7)
There are four squares marked with 1’s, one for each minterm that produces 1 for the
function.
Two adjacent squares are combined in the third column. This column belongs to both B
and C produces the term BC.
The remaining two squares with 1’s in the two corner of the second row are adjacent and
belong to row columns of C’, so they produce the term AC’.
BC
A
0 00 01 11 10
1 3
4 7 6
This approach is similar to the Sum-of-Products simplification, but identifying adjacent squares
containing 0’s instead of 1’s forms the groups of adjacent squares.
Then, instead of representing the function as a sum of products, the function is represented as a
product of sums.
Sometimes a situation arises in which some input variable combinations are not allowed. For
example, recall that in the BCD code there are six invalid combinations: 1010, 1011, 1100, 1101,
1110, and 1111. Since these un allowed states will never occur in an application involving the
BCD code, they can be treated as "don't care" terms with respect to their effect on the output.
That is, for these "don't care" terms either a 1 or a 0 may be assigned to the output: it really does
not matter since they will never occur. The "don't care" terms can be used to advantage on the
Karnaugh map. Fig.(5-9) shows that for each "don't care" term, an X is placed in the cell. When
grouping the 1 s, the Xs can be treated as 1s to make a larger grouping or as 0s if they cannot be
used to advantage. The larger a group, the simpler the resulting term will be. The truth table in
Fig.(5-9)(a) describes a logic function that has a 1 output only when the BCD code for 7,8, or 9
is present on the inputs. If the "don't cares" are used as 1s, the resulting expression for the
function is A + BCD, as indicated in part (b). If the "don't cares" are not used as 1s, the resulting
expression is ABC + ABCD: so you can see the advantage of using "don't care" terms to get the
simplest expression.
A combinational circuit is a connected arrangement of logic gates with a set of inputs and
outputs.
At any given time, the binary values of the outputs are a function of the binary values of the
inputs.
The design of a combinational circuit starts from a verbal outline of the problem and ends in a
logic circuit diagram.
Problem:
Solution:
Using the levels assigned the circuit can then be drawn, as shown
Problem:
Consider the function .
Multiply out the brackets, assign the levels to this function and implement.
Solution:
This is the same function as used in the previous example, except this time we will multiply out
the brackets first and then assign the levels and implement the circuit, giving an alternative
implementation for the function.
ADDERS
Adders are important in computers and also in other types of digital systems in which numerical
data are processed.
Basic type of adders
The Half-Adder
A half-adder adds two bits and produces a sum and a carry output
0+ 0= 0
0+ 1= 1
1+ 0= 1
1 + 1 = 10
The operations are performed by a logic circuit called a half-adder. The half-adder accepts two
binary digits on its inputs and produces two binary digits on its outputs, a sum bit and a carry bit.
A half-adder is represented by the logic symbol in Fig.(7-1). Half-Adder Logic: From the
operation of the half-adder as stated in Table 7-1, expressions can be derived for the sum and the
output carry as functions of the inputs. Notice that the output Carry (Cout) is a 1 only when both
A and B are 1s: therefore. Cout can be expressed
Cout = AB
Now observe that the sum output ( ∑ ) is a 1 only if the input variables A and B, are not equal.
The sum can therefore be expressed as the exclusive-OR of the input variables.
∑=AB
The Full-Adder
The second category of adder is the full-adder. The full-adder accepts two input bits and an input
carry and generates a sum output and an output carry.
The basic difference between a full-adder and a half-adder is that the full-adder accepts an input
carry. A logic symbol for a full-adder is shown in Fig.(7-3), and the truth table in Table 7-2
shows the operation of a full-adder.
Example: For each of the three full-adders in Fig.(7-6), determine the outputs for the inputs
shown.
Additional examples of combinational circuits:
Decoders
A decoder is a combinational circuit that converts binary information from the n coded inputs to
a maximum of 2n unique outputs
A decoder has n inputs and m outputs, where m ≤ 2n, and are called n-to-m-line decoders
Each output represents one of the combinations of the input variables .An enable input controls
operation of the decoder
Enable A0 A1 D0 D1 D2 D3
0 X X 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
Decoder expansion
If only small decoders are available and we want bigger ones, then we can build bigger
decoders from smaller ones.
The output lines generate the binary code corresponding to the input value
D3 D2 D1 D0 A1 A0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
Multiplexer
A multiplexer (MUX) is a combinational circuit with 2n input data lines, n input select lines, and
one output line .The input selection lines determine which input data line is selected for the
output
A multiplexer acts like a television channel selector. All of the stations are broadcast constantly
to the television's input, but only the channel that has been selected is displayed
Demultiplexers
The previous section described how multiplexers select one channel from a group of input
channels to be sent to a single output. Demultiplexers take a single input and select one channel
out of a group of output channels to which it will route the input. It's like having multiple printers
connected to a computer. A document can only be printed to one of the printers, so the computer
selects one out of the group of printers to which it will send its output.
The design of a demultiplexer is much like the design of a decoder. The decoder selected one of
many outputs to which it would send a zero. The difference is that the demultiplexer sends data
to that output rather than a zero.
The circuit of a demultiplexer is based on the non-active-low decoder where each output is
connected to an AND gate. An input is added to each of the AND gates that will contain the
demultiplexer's data input. If the data input equals one, then the output of the AND gate that is
selected by the selector inputs will be a one. If the data input equals zero, then the output of the
selected AND gate will be zero. Meanwhile, all of the other AND gates output a zero, i.e., no
data is passed to them. Figure 8-27 presents a demultiplexer circuit with two selector inputs.
S1 S0 Data D0 D1 D2 D3
0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 0
1 0 0 0 0 0 0
1 0 1 0 0 1 0
1 1 0 0 0 0 0
1 1 1 0 0 0 1
Sequential Circuits
Sequential circuits consist of a combinational circuit and some memory elements. The memory
elements are used to store information about the past. Therefore, in sequential circuits, the
present inputs and the history of the circuit determine the outputs. The history of the circuit is a
summary of the past inputs (or the effect of past inputs).
The memory elements used in sequential circuits are called flip-flops. Flip-flops can store or
remember a 0 or a 1 (a Boolean value). We use the term bit (binary digit) to refer to a Boolean
value. So, flip-flops can store a one-bit data (information). The value stored in a flip-flop is
called the state of the flip-flop, and is designated by the letter Q. A Flip-flop may have one or
more inputs used for changing it’s state (or the value it stores), and an output which is its state
(Q). A second output, Q’ is also usually provided, which is the complement of the state of the
flip-flop.
The following are some of the common flip-flop types used in sequential circuits:
Present Next
Inputs State
S R Q(t+1)
0 0 Q(t) Store
0 1 0 Reset
1 0 1 Set
1 1 ? Not Allowed
JK Flip-Flop
Present Next
Inputs State
J K Q(t+1)
0 0 Q(t) Store
0 1 0 Reset
1 0 1 Set
1 1 Q’(t+1) Toggle
T (Togle) Flip-Flop
Present Next
Input State
T Q(t+1)
0 Q(t) Store
1 Q’(1) Toggle
Register
A register is a group of flip-flops with each flip-flop capable of storing one bit of information
A register may also have combinational gates that perform certain data-processing tasks
The flip-flops hold the data and the gates control when and how new data is transferred into the
register
The flip-flops have a common clock input
The transfer of new data into a register is called loading the register
If all bits are loaded simultaneously with a common clock pulse transition, then the loading is
done in parallel
The load input determines the action to be taken with each clock pulse
If the load input is 1, then the data in the four inputs are transferred at the next positive clock
transition
If the load input is 0, the data inputs are inhibited and the output is fed back to simulate a no
change condition
2. SHIFT REGISTER:
A shift register is capable of shifting its binary information in one or both directions
The logical configuration is a chain of flip-flops, with the output of one connected to the input
of the next
The serial input determines what goes into the leftmost position during the shift
The serial output is taken from the output of the rightmost flip-flop
The most general shift register has all the following capabilities:
A shift-right operation and a serial input line associated with the shift-right
A shift-left operation and a serial input line associated with the shift-left
A parallel load operation and n input lines associated with the parallel transfer
Binary Counters
A register that goes through a predetermined sequence of states upon the application of
input pulses
Input pulses can be of regular intervals (like a clock) or occurring at irregular intervals
A counter that follows the binary number sequence is called a binary counter
Used to count the number of occurrences of an event and for generating timing signals to control
the sequence of operations
An n-bit binary counter is a register of n flip-flops and gates that follow a sequence of states
Consider the sequence 0000, 0001, 0010, 0011, 1000, …
Every other bit is complemented iff all its lower-order bits are equal to 1
Natural to use either T or JK flip-flops since they both have a complement state
The chain of AND gates generate the logic for the flip-flop inputs
A digital computer is characterized by its registers. The memory unit is merely a collection of
thousands of registers for storing digital information. The processor unit is composed of various
registers that store operands upon which operations are performed. The control unit uses registers
to keep track of various computer sequences, and every input or output device must have at least
one register to store the information transferred to or from the device. An inter register transfer
operation, a basic operation in digital systems, consists of a transfer of the information stored in
one register into another. The transfer of information among registers and demonstrates
pictorially the transfer of binary information from a keyboard into a register in the memory unit.
The input unit is assumed to have a keyboard, a control circuit, and an input register. Each time a
key is struck, the control enters into the input register an equivalent eight-bit alphanumeric
character code. The information from the input register is transferred into the eight least
significant cells of a processor register. After every transfer, the input register is cleared to
enable the control to insert a new eight-bit code when the keyboard is struck again. Each eight-
bit character transferred to the processor register is preceded by a shift of the previous character
to the next eight cells on its left. When a transfer of four characters is completed, the processor
register is full, and its contents are transferred into a memory register.
To process discrete quantities of information in binary form, a computer must be provided with
(1) devices that hold the data to be processed and (2) circuit elements that manipulate individual
bits of information. The device most commonly used for holding data is a register. Manipulation
of binary variables is done by means of digital logic circuits.