Professional Documents
Culture Documents
U N I T - IV
SUBSYSTEM DESIGN
Dr. D SUDHA ( ASSISTENT PROFESSOR)
C O NTENTS
2
Outline
UNIT IV 🠶 Shifters, Adders
– Example:
1100 : 1210 multiplicand
0101 : 510 multiplier
1100
0000 partial
1100 products
0000
– M x N-bit multiplication
00111100 : 6010 product
– Produce N M-bit partial products
– S u m these to produce M+N-bit product
– Product: N 1 M
M 1 N
P y j 2 xi 2
i 1 j
xi y j 2i j
1
j 0 i0 j0
i0
y5 y4 y3 y2 y1 y0 multiplicand
x5 x4 x3 x2 x1 x0 multiplier
x0 y 5 x0y4 x0 y 3 x0 y2 x0 y 1 x 0 y0
x 1y 5 x1 y 4 x1y3 x1 y 2 x1 y1 x1 y 0
x0
partial products
multiplier x
x15
skew array
for rectangular
layout
X3 X2 X1 X0
× Y3 Y2 Y1 Y0
X3Y0 X2Y0 X1Y0 X0Y0
X3Y1
X3Y2 X2Y1 X1Y1 X0Y1
X3Y3 X2Y2
P7 P6 XP2Y
5 3 P4 XP1Y
3 2 XP0Y
2 2 P1 P0
X1Y3
X0Y3
x0
x1
CSA
A rra y
x2
x3
CPA
p7 p6 p5 p4 p3 p2 p1 p0
A B
S in A C in c r i t i ca l p a t h A B
A B
B S in
= Cout C in = Cout C in
Cout C in
S out
Cout S out S out
S out
y3 y2 y1 y0
x0
p0
x1
p1
x2
p2
x3
p3
p7 p6 p5 p4
a2 b 2 c 2 a1 b1 c1 a0 b0 c0 carry-ripple
adder
FA FA FA
s2 s1 s0
a2 b 2 c 2 a1 b 1 c 1 a0 b0 c0
carry-save
FA FA FA adder
z 3 y2 z 2 y1 z1 y0
n2 n n
XY xn 1 yn 2n
2
xi y i 2
y y x ) i n 1
1
2
i0 j 2j
j
i
n 1 i n 1
2 i
2x 1 yi 1
0
(x
0
i i
X Y ( n 1y n xn n ) 2 2 n ( n x1i y n ) 2 n y
x n 2 yn
1 1 1 2
n x1 1
2
x
i 0 j 2j
i y i
j
2
n 1 y i n 1x )2 i n
i0 i y
1
0 2n2 n 1
XY 2 2 ( x y n 1 ) 2 ( x n 1
n 1 ( x n 1 y x n y n 1 ) 2
n2 n n2
n 1 1 i
n 1 y n 1x )2 i n
2
xi y j
i 0 j 2j i y i 1
0
(x
16 Department of Electronics andi Communication
0 Engineering, VIDYA SAGAR P
Two’s Complement Array Multiplication
x3 y 0 0 x2 y 0 0 x1 y 0 0 x0 y 0
a P0
Cin + x2 y 1 + x1 y 1 + x0 y 1
x3 y 1
+ b P1
x3 y 3 x 3y 2 + x 2y 2 + x1y2 + x0y2
P2
Cout Sum + xy x 2y 3 + x1y3 + x0y3 x3
1 3 3 +
+ + + + + y3
P7 P6 P5 P4 P3
– n1 n2
n3
Y yn1 2 y n2 2 yn3 2 ...
Y (n y2 n 1)2 n 1 n ( 3y n 2 y n4 n )2 n3
–
y first
Consider
)2 n 2 ( y y
3 two terms ...
–
XY ( n 1 2 y n 2 ny 3 y n 3 n 4 n ( 2 y
) X 2 n2
y
– By looking at5 three
product.
bits ofyy, we
) X
can2determine
n4
...
whether to add x, 2x to partial
– Instead of 3Y, try –Y, then increment next partial product to add 4Y
– Similarly, for 2Y, try –2Y + 4Y in next partial product
0 x-1
ss s s s s s s s s s s s s s sss x0
ss sss ssss s s PP0
ss s s s s s s s s s ss s
ss sss ss s PP1
ss s s s s s s s
ss ss s PP2
multiplier x
ss s s
s s PP3
s
PP4
PP5
PP6
x15
PP7 0 x16
PP 8 0 x17
11011
00000 11011
– Use the LSB (least significant bit) and the previous LSB
to determine the arithmetic action.
– If it is the FIRST pass, use 0 as the previous L S B .
– 10 no arithmetic operation
28 Department of Electronics and Communication Engineering, VIDYA SAGAR P
Step 2 for each pass
– And we added 5 leading zeros to the multiplier to get the beginning product:
00000 11011
00000 11011 0
(Note: Since this is the first pass, we use 0 for the previous LSB)
00000 11011 0
The last two bits are 10, so we need to:
subtract the multiplicand from left half of product
11110 11011 0
– Before AS R
11110 11011 0
– After AS R
11111 01101 1
(left-most bit was 1, so a 1 was shifted in on
the left)
– Pass 1 is complete.
11111 01101 1
11111 01101 1
The last two bits are 11, so we do NOT need to perform an arithmetic action
-- just proceed to step 2.
– Before AS R
11111 01101 1
– After AS R
11111 10110 1
(left-most bit was 1, so a 1 was shifted in on the
left)
– Pass 2 is complete.
11111 10110 1
11111 10110 1
The last two bits are 01, so we need to:
00001 10110 1
37 Department of Electronics and Communication Engineering, VIDYA SAGAR P
Example: Pass 3 continued
– Before AS R
00001 10110 1
– After AS R
00000 11011 0
(left-most bit was 0, so a 0 was shifted in on
the left)
– Pass 3 is complete.
00000 11011 0
00000 11011 0
The last two bits are 10, so we need to:
subtract the multiplicand from the
left half of the product
11110 11011 0
– Before AS R
11110 11011 0
– After AS R
11111 01101 1
(left-most bit was 1, so a 1 was shifted in on
the left)
– Pass 4 is complete.
11111 01101 1
11111 01101 1
The last two bits are 11, so we do NOT need to perform an arithmetic action
-- just proceed to step 2.
– Before AS R
11111 01101 1
– After AS R
11111 10110 1
(left-most bit was 1, so a 1 was shifted in on the
left)
– Pass 5 is complete.
11111 10110
– To confirm we have the correct answer, convert the 2's complement final product back to
decimal.
(-5) x 2
A0
A 7
allones
A 6
A 5
A 4
A 3
B[3]
A[3]
B[2]
A[2] A=B
B[1]
A[1]
B[0]
A[0]
A
1
49
B Engineering,
Department of Electronics and Communication VIDYA SAGAR P
Signed vs. Unsigned
Logical Shift:
Shifts number left or right and fills with 0’s
1011 LS R 1 = 0101 1011 LSL1 =
0110
Arithmetic Shift:
Shifts number left or right. Rt shift sign
extends
1011 A S R 1 = 1101 1011 AS L1 =
0110
Rotate:
Shifts number left or right and fills with lost bits
1011 R O R 1 = 1101 1011 ROL1 =
0111
• A rotate is a shift in which the bits shifted out are inserted into the positions vacated
• The circuit rotates its contents left from 0 to 3 positions depending on Selector S.
– Single-bit Addition
– Carry-Ripple Adder
– Carry-Skip Adder
– Carry-Lookahead Adder
– Carry-Select Adder
– Carry Save Adder
A B
Half Adder Full Adder
A B C out C
S AB
S AB C out C C MAJ ( A,
S
out
A B S
B,C)
C out
A B Cout S A B C Cou
S
0 0 0 0 t
0 1 0 1 0 0 0 0 0
1 0 0 1 0 0 1 0 1
1 1 1 0 0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
– K = ~A • ~B
A B B
B S B
C C
C A B B
S
C C C A
J
MA
A C out
B B C out
B B C A
C
A B B
A A
AN...1 BN...1
Cout Cout Cin
Cin
00000
C out C in 11111 carries
+ 1111
1111 A4...1
+0000
+0000 B4...1
S N...1 1111
0000 S4...1
A4 B4 A3 B3 A2 B2 A1 B1
Cout C3 C2 C1 Cin
S4 S3 S2 S1
ci+1 = Gi + Pi.ci
si = Pi ⊕ ci
Where Gi = ai.bi
Pi = (ai⊕ bi)
A4 B4 A3 B3 A2 B2 A1 B1
Cin
1: Bitwise PG logic
G4 P4 G3 P3 G2 P2 G1 P1 G0 P0
2: Group PG logic
C3 C2 C1 C0
3: Sum logic
C4
S4 S3 S2 S1
Cout
B4:1
0 0 0
+ + +
C8 C4
C out C 12
1 1
+ + + 1 + C in
1
1
0
0
S 16:13 S 12:9 S 8:5 S 4:1
– The carry-save adder block is the same circuit as the full adder
The name “carry-save” arises from the fact that we save the carry-out word instead
using it immediately to calculate a final s u m .
X4 Y4 Z4 X3 Y3 Z3 X2 Y2 Z2 X1 Y1 Z 1
C4 S4 C 3 S3 C2 S2 C 1 S1
n-bit CSA
CN...1 SN...1
The simplest counter circuits can be built using T flip-flops because the toggle feature is
naturally suited for the implementation of the counting operation. Counters are available in
two categories.
1. Asynchronous(Ripple counters) Asynchronous counters, also known as ripple counters,
are not clocked by a common pulse and hence every ip- op in the counter changes at
different times.
EX:- Binary ripple counters, BCD ripple counters
2.Synchronous counters A synchronous counter however, has an internal clock, and the
external event is used to produce a pulse which is synchronized with this internal clock.
E.X.:- Binary counter, Up-down Binary counter, BCD Binary counter, Ring counter, Johnson
Counter.
A 3-bit down-counter
SRAM
DRAM
RO M
Serial Access Memories
Content Addressable Memory
76
Memory Arrays
Fused RO M s -D ata is written by blowing the fuse electrically, hence cannot be modified later
Programmable Read Only Memories (PROMs) :Data is written after chip fabrication
Erasable PROMs -Complete block is erased using U V light which is penetrated through glass
window
Flash - Programmed using high electrical voltage. Erases data in blocks hence faster
words
k = Log2(m) address input signals …
m
or m = 2 k words
e.g., 4,096 x 8 memory:
n bits per word
32, 768 bits
memory external
12 a d d ress input signals view
r/w
8 input/output data signals 2k × n read and write memory
enable
Memory access
A0
r/w: selects read or write …
enable: read or write only when asserted Ak-1
…
multiport: multiple accesses to different locations simultaneously
Q0
Qn-1
…
Store software program for general-purpose processor Ak-1
…
Store constant data (parameters) needed by system
Implement combinational circuits (e.g., decoders)
Q0
Qn-1
a NOR-based ROM
is similar to a Hex
Keypad
(b) Large positive voltage at gate causes negative charges to move out
(a)
of channel and get trapped in floating gate storing a logic 0
(c) (Erase) Shining UV rays on surface of floating-gate causes negative +15V
charges to return to channel from floating gate restoring the logic 1 source drain
(b)
(d) An EPROM package showing quartz window through which UV
light can pass 5-30 min
(c)
can be erased and reprogrammed thousands of times
Reduced storage permanence
(d)
program lasts about 10 years but is susceptible to radiation and
electric noise,Typically used during design .
88
development Department of Electronics and Communication Engineering, VIDYA SAGAR P
Sample EPROM components
clk
Din Dout
8
clk
Sin
P0 P1 P2 P3
P0 P1 P2 P3
shift/load
clk
Sout
b it
w r it e
w r it e _ b
read
read_ b
SRAM memory
cell
N1 >> N2
1.0
w o rd b it
0.5
A
0.0
0 100 200 300 400 500 600
time (ps)
bi bit_
Drive one bitline high, the other low t b
wor
Then turn on wordline d
P1 P2
Bitlines overpower cell with new N2 N4
value A A_
Ex: A = 0, A_b = 1, bit = 1, bit_b = 0 N1 b
N3
Force A_b low, then A rises high
A_b
Writability
1.5 A
Must overpower feedback inverter
bit_b
N2 >> P1 1.0
0.5
word
0.0
0 100 200 300 400 500 600 700
time (ps)
DRAM store their contents as charge on a capacitor rather than in a feedback loop.
The cell must be periodically read and refreshed so that its contents do not leak
away. Like SRAM accessed by asserting wordline to connect the capacitor to the
bitline.
When wordline rises the capacitor shares its charge with the bitline causing a voltage
change that can be sensed.
some DRAMs drive the wordline to Vddp=Vdd+Vt to avoid degraded level when writing a ‘1’.
DRAM capacitor must be physically small as possible to achieve good density.
According to charge-sharing equation the voltage swing on bitline during readout is
adr data/key
read
CAM match
write
01 0 1 1 0 X
01
10 0 1 1 X X
11 1 0 0 1 1
0 1 1 0 1
Content Addressable
Memory
They associate the input (comparand) with their memory contents in one clock
cycle.
They are configurable in multiple formats of width and depth of search data
that allows searches to be conducted in parallel.
CAM can be cascaded to increase the size of lookup tables that they can
store.
We can add new entries into their table to learn what they don’t know
before.
They are one of the appropriate solutions for higher speeds.
They cost several hundred of dollars per CAM even in large quantities.
They occupy a relatively large footprint on a card.
They consume excessive power.
Generic system engineering problems:
Interface with network processor.
Simultaneous table update and looking up requests.