CE222_Slides2
CE222_Slides2
Salman Ashraf
R2 R1
R2 R1
– the data lines from the source register (R1) to the destination
register (R2)
– Parallel load capability at destination register (R2)
– Control lines to perform the action
CLOCK
• Clock: In digital circuit design, clock means a signal
that oscillates between 0 and 1 in a regular fashion.
– All computers are constructed using a clock running at constant
rate.
– Ticks of the clock act as synchronizing events that keep other
components in step with each other.
Features of a clock
P: R2 R1
Load
Transfer occurs here
Computer Arithmetic
Registers and
I/O Login Unit
System CPU
Bus
Internal CPU
Memory Interconnection
Control
Unit
BUS AND BUS TRANSFER
• Bus is a shared path (a set of common lines, one for each bit
of a register) over which information is transferred (one at a
time), from any of several sources to any of several
destinations.
A B C D
Bus lines
Constructing A Bus System using
Multiplexers
RECALL MULTIPLEXER
4-to-1 Multiplexer
I0
Function Table
I1 Select Output
Y S1 S0 Y
I2
0 0 I0
I3 0 1 I1
1 0 I2
1 1 I3
S0
S1
BUS SYSTEM FOR FOUR REGISTERS
Register A Register B Register C Register D
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
B0 C 0 D 0 B1 C 1 D 1 B2 C 2 D 2 B3 C 3 D 3
0 0 0 0
4x1 4x1 4x1 4x1
MUX−0 MUX−1 MUX−2 MUX−3
S0
Register
S1 S1 S0 selected
0 0 A
0 1 B
4-line bus 1 0 C
1 1 D
In general, a bus system multiplexes k registers, of n bits each, to produce n-line bus using
n multiplexers. The size of each multiplexer must be k x 1.
Constructing A Bus System using
Decoders and Three-State Gates
RECALL DECODERS
2-to-4 Decoder
D0
E S1 S0 D0 D1 D2 D3
S0 D1
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0 D2
1 1 1 0 0 0 1
0 d d 0 0 0 0 D3
S1
E
THREE-STATE GATE
The High impedance state behaves like an open circuit, which means
that the output is disconnected.
BUS LINE WITH THREE-STATE GATES
Output Y if C=1, output is enabled, i.e., Y = A
Normal input A
if C=0, output is disabled (High-impedance),
Control input C regardless of the value of A
0
Register D Register C Register B Register A
1
2
3
Bus line for bit 0
A0
0
0 E S1 S0 D0 D1 D2 D3
1
1
B0
2 C0 1 0 0 1 0 0 0
2
3
3 D0 1 0 1 0 1 0 0
1 1 0 0 0 1 0
0
S0 0 1 1 1 0 0 0 1
1 1
2
S1 2 0 d d 0 0 0 0
3 E 3
2x4
0 decoder
1
2
3
• Each group of four gates receives one bit from the four registers.
• Each output produces one of the lines for the common bus for a total of 4 lines.
• Only one decoder is necessary to select between the four registers.
• To construct a common bus for k registers of n bits each using three-state gates,
we need n circuits with k gates in each.
BUS TRANSFER IN RTL
address lines
k RAM
Read
unit
Write
n
data output lines
M
Memory Read
AR
unit Write
y y
x y c s
0 0 0 0 0 0 0 1
0
1
1
0
0
0
1
1
x 01 x 1 0
1 1 1 0 c = xy s = xy’ + x’y
=x y
x
y c
s
BINARY INCREMENTER
Increment: S A + 1
A3 A2 A1 A0 1
x y x y x y x y
HA HA HA HA
C S C S C S C S
C4 S3 S2 S1 S0
• The circuit receives four bits from A0 through A3, adds one to it, and
generates the incremented output in S0 through S3 (S A + 1).
• The output carry C4 will be 1 only after incrementing binary 1111.
• The circuit can be extended to an n-bit binary incrementer by extending
the diagram to include n half-adders.
Designing Binary Adder
RECALL FULL ADDER
• A digital circuit that forms the arithmetic sum of three bits (two
significant bits and a previous carry) is called a full-adder.
x y cn-1 cn s y y
0 0 0 0 0 0 0 0 1
0 0 1 0 1 0 1 cn-1 1 0 cn-1
0 1 0 0 1 1 1 0 1
x x
0 1 1 1 0
1 0 0 0 1 0 1 1 0
cn s
1 0 1 1 0
1 1 0 1 0 cn = xy + xcn-1+ ycn-1
1 1 1 1 1 = xy + (x y)cn-1
s = x’y’cn-1+x’yc’n-1+xy’c’n-1+xycn-1
x = x y cn-1 = (x y) cn-1
y S
cn-1
cn
BINARY ADDER
Addition: S A + B
• A digital circuit that generates the arithmetic sum of two binary numbers of
any length is called a binary adder.
B3 A3 B2 A2 B1 A1 B0 A0
FA C3 FA C2 FA C1 FA C0
C4 S3 S2 S1 S0
4-bit Adder
• The S outputs of the full-adders generate the required sum bits (S A + B).
• An n-bit binary adder requires n full-adders.
BINARY SUBTRACTOR
Subtraction
R3 R1 - R2
or
R3 R1 + R2’+1
B3 A3 B2 A2 B1 A1 B0 A0
I
M
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
4-bit Adder-Subtractor
R1 R1 + 1 Increment
R1 R1 - 1 Decrement
R3 R1 + R2 Contents of R1 plus R2 transferred to R3
R3 R1 + R2’+1 Subtraction (R1 – R2)
By controlling the data inputs to the full adders, it is possible to obtain eight
arithmetic microoperations.
ARITHMETIC CIRCUIT FUNCTION TABLE
FA FA
Selection Input Output Microoperation
S1 S0 Cin Y D=A+Y+Cin
0 0 0 B D=A+B Add
0 0 1 B D=A+B+1 Add with carry
0 1 0 B’ D = A + B’ Subtract with borrow
0 1 1 B’ D = A + B’+ 1 Subtract
1 0 0 0 D=A Transfer A
1 0 1 0 D=A+1 Increment A
1 1 0 1 D=A-1 Decrement A (A+ all 1’s = A-1)
1 1 1 1 D=A Transfer A (A-1 + 1 = A)