Docsity

Digital Design: Magnitude Comparators, Counters, Incrementers, Timers, and Subtractors - P, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
Digital Design
Copyright ©2006
Frank Vahid
ECE 474a/575a
Susan Lysecky
1of 58
Digital Design
Chapter 4.4 – 4.10:
Datapath Components
Digital Design
Copyright ©2006
Frank Vahid
ECE 474a/575a
Susan Lysecky
2of 58
Shifters
Shifting (e.g., left shifting 0011 yields 0110) useful for:
Manipulating bits
Converting serial data to parallel (remember earlier above-mirror displ ay example with shift
registers)
Shift left once is same as multiplying by 2 (0011 (3) becomes 0110 (6))
Why? Essentially appending a 0 -- Note that multiplying decimal number by 10 accomplished just be
appending 0, i.e., by shifting left (55 becomes 550)
Shift right once same as dividing by 2
i2
q3 q2 q1 q0
in
i3 i1 i0
Left shifter
01 01 01 01
in
sh
i3
q3 q2 q1 q0
i2 i1 i0
Shifter with left shift
or no shift
inL
i3
q3 q2 q1 q0
i2 i1 i0
inR
20 s0
s1
shL
shR
1 201 201 201
Shifter with left
shift, right shift,
and no shift
<<1
Symbol
4.4
a
Digital Design
Copyright ©2006
Frank Vahid
ECE 474a/575a
Susan Lysecky
3of 58
Shifter Example: Approximate Celsius to Fahrenheit Converter
Convert 8-bit Celsius input to 8-bit Fahrenheit output
F = C * 9/5 + 32
Approximate: F = C*2 + 32
Use left shift: F = left_shift(C) + 32
C
8
00001100 (12)
00011000 (24)
00111000 (56)
<<1 0 (shift in 0)
8
F
8-bit adder
88
00100000 (32)
* 2
a
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Digital Design: Magnitude Comparators, Counters, Incrementers, Timers, and Subtractors - P and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

1 of 58

Digital Design

Chapter 4.4 – 4.10:

Datapath Components

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 2 of 58

Shifters

ƒ Shifting (e.g., left shifting 0011 yields 0110) useful for:

ƒ Manipulating bits
ƒ Converting serial data to parallel (remember earlier above-mirror display example with shift
registers)
ƒ Shift left once is same as multiplying by 2 (0011 (3) becomes 0110 (6))

ƒ Why? Essentially appending a 0 -- Note that multiplying decimal number by 10 accomplished just be appending 0, i.e., by shifting left (55 becomes 550)

ƒ Shift right once same as dividing by 2

i

q3 q2 q1 q

in

i3 i1 i

Left shifter

in

sh

i

q3 q2 q1 q

i2 i1 i

Shifter with left shift
or no shift

inL

i

q3 q2 q1 q

i2 i1 i

inR

2 0 s s

shL shR

Shifter with left
shift, right shift,
and no shift
Symbol

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 3 of 58

Shifter Example: Approximate Celsius to Fahrenheit Converter

ƒ Convert 8-bit Celsius input to 8-bit Fahrenheit output

ƒ F = C * 9/5 + 32

ƒ Approximate: F = C*2 + 32

ƒ Use left shift: F = left_shift(C) + 32

C
<<1 0 (shift in 0)
F
8-bit adder

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

4 of 58

Shifter Example: Temperature Averager

ƒ Four registers storing a history of

temperatures

ƒ Want to output the average of those

temperatures

ƒ Add, then divide by four

ƒ Same as shift right by 2
ƒ Use three adders, and right shift by two
Tavg
ldRavg
ld
T
clk
ld
Ra Rb Rc Rd

shift in 0 divide by 4

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 5 of 58

Barrel Shifter

ƒ A shifter that can shift by any amount

ƒ 4-bit barrel left shift can shift left by 0,
1, 2, or 3 positions
ƒ 8-bit barrel left shifter can shift left by
0, 1, 2, 3, 4, 5, 6, or 7 positions

ƒ (Shifting an 8-bit number by 8 positions is pointless -- you just lose all the bits)

ƒ Could design using 8x1 muxes and lots

of wires

ƒ Too many wires

ƒ More elegant design

ƒ Chain three shifters: 4, 2, and 1
ƒ Can achieve any shift of 0..7 by
enabling the correct combination of
those three shifters, i.e., shifts should
sum to desired amount

in sh

i

q3 q2 q1 q

i2 i1 i

Shift by 1 shifter uses 2x1 muxes. 8x
mux solution for 8-bit barrel shifter: too
many wires.
sh <<1 in
x
y
z
Q
sh <<2 in
sh <<4 in
Q: xyz to shift by 5? I

1 a

01100000 (by 4)
11000000 (by 1)
Net result: shift by 5

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 6 of 58

Comparators

ƒ N-bit equality comparator : Outputs 1 if two N-bit numbers are equal

ƒ 4-bit equality comparator with inputs A and B

ƒ a3 must equal b3, a2 = b2, a1 = b1, a0 = b ƒ Two bits are equal if both 1, or both 0 ƒ eq = (a3b3 + a3’b3’) * (a2b2 + a2’b2’) * (a1b1 + a1’b1’) * (a0b0 + a0’b0’) ƒ Recall that XNOR outputs 1 if its two input bits are the same ƒ eq = (a3 xnor b3) * (a2 xnor b2) * (a1 xnor b1) * (a0 xnor b0)

a3 b3 a2 b2 a1 b1 a0 b

eq (a)

(b)

a3 a2a1 a0 b

eq

b2b1 b 4-bit equality comparator

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

10 of 58

Magnitude Comparator

ƒ How does it work?

ƒ Final answer appears on the right

ƒ Takes time for answer to “ripple” from left to right

ƒ Called “carry-ripple style” after the carry-ripple adder, even though there’s no “carry”
involved

0 1 0

0 1 0

0 1 0

Ieq=1 causes this stage3 to compare

a

1

0

0 0

1

0

in_gt in_eq in_lt

out_gt out_eq out_lt

Igt Ieq llt

Stage 3

a3 b

a b in_gt in_eq in_lt

out_gt out_eq out_lt

Stage

a2 b

a b in_gt in_eq in_lt

out_gt out_eq out_lt

Stage

a1 b

a b in_gt in_eq in_lt

out_gt out_eq out_lt

AgtB AeqB AltB

Stage

a0 b

a b

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 11 of 58

Magnitude Comparator Example: Minimum of Two Numbers

ƒ Design a combinational component that computes the minimum of two 8-bit numbers

ƒ Solution: Use 8-bit magnitude comparator and 8-bit 2x1 mux

ƒ If A<B, pass A through mux. Else, pass B.
MIN

Igt Ieq Ilt

AgtB AeqB AltB

A
A B
B

8-bit magnitude comparator

s I1^ I 2x1 mux

8-bit

C
C
A B

Min

(a)

(b)

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 12 of 58

Counters

ƒ N-bit up-counter : N-bit register that

can increment (add 1) to its own value

on each clock cycle

ƒ Note how count “rolls over” from 1111
to 0000

ƒ Terminal (last) count, tc, equals1 during value just before rollover

ƒ Internal design

ƒ Register, incrementer, and N-input
AND gate to detect terminal count

ld 4-bit register

tc C

cnt

4-bit up-counter

a

a

cnt tc C

4-bit up-counter

4

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

13 of 58

Incrementer

ƒ Counter design used incrementer

ƒ Incrementer design

ƒ Could use carry-ripple adder with B input set to 00...

ƒ But when adding 00...001 to another number, the leading 0’s obviously don’t need to be considered -- so just two bits being added per column

ƒ Use half-adders (adds two bits) rather than full-adders (adds three bits)
carries:
unused
(a)
(b)
a3 a2 a1 a0 1
cos3 s2 s1 s
a b
co s
HA
a b
co s
HA
a b
co s
HA
a b
co s
HA

I

r

nt

a
co s3s
s1 s
a2 a1 a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 14 of 58

Incrementer

ƒ Can build faster incrementer using

combinational logic design process

ƒ Capture truth table
ƒ Derive equation for each output

ƒ c0 = a3a2a1a ƒ ... ƒ s0 = a0’

ƒ Results in small and fast circuit
ƒ Note: works for small N -- larger N leads to
exponential growth, like for N-bit adder

s 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0

s 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0

s 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0

s 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0

c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

a 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

a 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

a 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

Inputs Outputs a 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 15 of 58

Counter Example: Mode in Above-Mirror Display

ƒ Recall above-mirror display example from Chapter 2

ƒ Assumed component that incremented xy input each time button pressed: 00, 01, 10, 11,
ƒ Can use 2-bit up-counter

ƒ Assumes mode=1 for just one clock cycle during each button press ƒ Recall “Button press synchronizer” example from Chapter 3

cnt tc c1c

x y

2-bit upcounter mode

clk

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

19 of 58

Counter Example: Light Sequencer

ƒ Illuminate 8 lights from right to

left, one at a time, one per second

ƒ Use 3-bit up-counter to counter

from 0 to 7

ƒ Use 3x8 decoder to illuminate

appropriate light

ƒ Note: Used 3-bit counter with 3x

decoder

ƒ NOT an 8-bit counter – why not?
lights
cnt^ 3-bit up-counter
tc c2 c1 c
3 x8 dcd i2 i1 i
unused
clk
(1 Hz)
d7 d6 d5 d4 d3 d2 d1 d

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 20 of 58

Counter with Parallel Load

ƒ Up-counter that can be

loaded with external value

ƒ Designed using 2x1 mux –
ld input selects incremented
value or external value
ƒ Load the internal register
when loading external value
or when counting
ld
4-bit register
tc C
cnt
ld
1 4-bit 2x 10
L 4

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 21 of 58

Counter with Parallel Load

ƒ Useful to create pulses at specific

multiples of clock

ƒ Not just at N-bit counter’s natural
wrap-around of 2 N

ƒ Example: Pulse every 9 clock

cycles

ƒ Use 4-bit down-counter with
parallel load
ƒ Set parallel load input to 8 (1000)
ƒ Use terminal count to reload

ƒ When count reaches 0, next cycle loads 8.

ƒ Why load 8 and not 9? Because 0
is included in count sequence:

ƒ 8, 7, 6, 5, 4, 3, 2, 1, 0 Æ 9 counts

cnt
ld
tc C
L
clk

4-bit down-counter

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

22 of 58

Counter Example: New Year’s Eve Countdown Display

ƒ Chapter 2 example previously used microprocessor to counter from 59 down to 0

in binary

ƒ Can use 8-bit (or 7- or 6-bit) down-counter instead, initially loaded with 59

i0^ d i i i i i

c c c c c c c c

tc

d d d

d d d d d d 6x dcd

8-bit down- counter

59 8 L

ld

cnt

clk (1 Hz)

reset

fireworks

Happy New Year

countdown

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 23 of 58

Counter Example: 1 Hz Pulse Generator from 60 Hz Clock

ƒ U.S. electricity standard uses 60 Hz

signal

ƒ Device may convert that to 1 Hz
signal to count seconds

ƒ Use 6-bit up-counter

ƒ Can count from 0 to 63
ƒ Create simple logic to detect 59
(for 60 counts)

ƒ Use to clear the counter back to 0 (or to load 0)

tc C
p
osc
(60 Hz)
(1 Hz)
clr
cnt 6-bit up counter

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 24 of 58

Timer

ƒ A type of counter used to measure time

ƒ If we know the counter’s clock frequency and the count, we know the time that’s been
counted

ƒ Example: Compute car’s speed using two sensors

ƒ First sensor (a) clears and starts timer
ƒ Second sensor (b) stops timer
ƒ Assuming clock of 1kHz, timer output represents time to travel between sensors.
Knowing the distance, we can compute speed

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

28 of 58

Subtractor

ƒ Can build subtractor as we built carry-ripple adder

ƒ Mimic subtraction by hand
ƒ Compute borrows from columns on left

ƒ Use full-subtractor component: ƒ wi is borrow by column on right, wo borrow from column on left

1stcolumn 1 1 0

3rd column 1 1 0

4th column

wo

a

a b FS

wi

wo s

b

s

a

a b FS

wi

wo s

b

s

a

a b FS

wi

wo s

b

s

a

a3 a2 a1 a0 b

wo s3s2s1s

wi

a b b2 b1 b FS

wi

wi

wo s

b

s (b) (c)

4-bit subtractor a

2ndcolumn 10

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 29 of 58

Subtractor Example: DIP-Switch Based Adding/Subtracting Calculator

ƒ Extend earlier calculator

example

ƒ Switch f indicates whether
want to add (f=0) or
subtract (f=1)
ƒ Use subtractor and 2x
mux

DIP switches 1 0

8-bit register CALC

LEDs

e

f

clk

ld

0 2 x 1 1

A B ci A Bwi

co S woS

8-bit adder 8-bit subtractor

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 30 of 58

Subtractor Example: Color Space Converter – RGB to CMYK

ƒ Color

ƒ Often represented as weights of
three colors: red, green, and blue
(RGB)

ƒ Perhaps 8 bits each, so specific color is 24 bits ƒ White: R=11111111, G=11111111, B= ƒ Black: R=00000000, G=00000000, B= ƒ Other colors: values in between, e.g., R=00111111, G=00000000, B= would be a reddish purple

ƒ Good for computer monitors,
which mix red, green, and blue
lights to form all colors
  • Printers use opposite color scheme
    • Because inks absorb light
    • Use complementary colors of RGB:
Cyan (absorbs red), reflects green and
blue, Magenta (absorbs green), and
Yellow (absorbs blue)

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

31 of 58

Subtractor Example: Color Space Converter – RGB to CMYK

ƒ Printers must quickly convert RGB

to CMY

ƒ C=255-R, M=255-G, Y=255-B
ƒ Use subtractors as shown

- - -

R G B
C M Y

R

GB

toCMY

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 32 of 58

Subtractor Example: Color Space Converter – RGB to CMYK

ƒ Try to save colored inks

ƒ Expensive
ƒ Imperfect – mixing C, M, Y doesn’t yield
good-looking black

ƒ Solution: Factor out the black or gray from

the color, print that part using black ink

ƒ e.g., CMY of (250,200,200)= (200,200,200) +

ƒ (200,200,200) is a dark gray – use black ink

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 33 of 58

Subtractor Example: Color Space Converter – RGB to CMYK

ƒ Call black part K

ƒ (200,200,200): K=
ƒ (Letter “B” already used for
blue)

ƒ Compute minimum of C, M, Y

values

ƒ Use MIN component designed
earlier, using comparator and
mux, to compute K
ƒ Output resulting K value, and
subtract K value from C, M, and
Y values
ƒ Ex: Input of (250,200,200)
yields output of (50,0,0,200)

RGB

toCM

K

C2 M2 Y2 K
MIN
MIN
C
C M Y
R G

RGB t o CMY

Y B

M Y
K
R 8 G 8 B 8

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

37 of 58

Two’s Complement is Easy to Compute: Just Invert Bits and Add 1

ƒ Hold on!

ƒ Sure, adding the ten’s complement achieves subtraction using addition only
ƒ But don’t we have to perform subtraction to have determined the complement in the
first place? e.g., we only know that the complement of 4 is 6 by subtracting 10-4=6 in
the first place.

ƒ True – but in binary, it turns out that the two’s complement can be computed

easily

ƒ Two’s complement of 011 is 101, because 011 + 101 is 1000
ƒ Could compute complement of 011 as 1000 – 011 = 101
ƒ Easier method: Just invert all the bits, and add 1
ƒ The complement of 011 is 100+1 = 101 -- it works!

Q: What is the two’s complement of 0101? A: 1010+1=

(check: 0101+1011=10000)

a

Q: What is the two’s complement of 0011? A: 1100+1=

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 38 of 58

Two’s Complement Subtractor Built with an Adder

ƒ Using two’s complement

A – B = A + (-B)

= A + (two’s complement of B)

= A + invert_bits(B) + 1

ƒ So build subtractor using adder by inverting

B’s bits, and setting carry in to 1 cin^1

A B
Adder
S
A B
N-bit

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 39 of 58

Adder/Subtractor

ƒ Adder/subtractor: control input

determines whether add or subtract

ƒ Can use 2x1 mux – sub input passes
either B or inverted B
ƒ Alternatively, can use XOR gates – if sub
input is 0, B’s bits pass through; if sub
input is 1, XORs invert B’s bits

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

40 of 58

Adder/Subtractor Example: Calculator

ƒ Previous calculator used separate adder and subtractor

ƒ Improve by using adder/subtractor, and two’s complement numbers

8-bit register

sub8-bit adder/subtractor

CALC

LEDs

S

A B

ld

8 8

8-bitregister CALC

ld

8 8 0 0

8

8

8

8 8 2x1 mux 0 1

A B ci A B wi co S woS

8-bit adder 8-bit subtractor

DIP switches 1 0

DIP switches 1 0

e

f

clk

e

f

clk

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 41 of 58

Overflow

ƒ Sometimes result can’t be represented with given number of bits

ƒ Either too large magnitude of positive or negative
ƒ e.g., 4-bit two’s complement addition of 0111+0001 (7+1=8). But 4-bit two’s complement
can’t represent number >

ƒ 0111+0001 = 1000 WRONG answer, 1000 in two’s complement is -8, not +

ƒ Adder/subtractor should indicate when overflow has occurred, so result can be discarded

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 42 of 58

Detecting Overflow: Method 1

ƒ Assuming 4-bit two’s complement numbers, can detect overflow by detecting when the

two numbers’ sign bits are the same but are different from the result’s sign bit

ƒ If the two numbers’ sign bits are different, overflow is impossible

ƒ Adding a positive and negative can’t exceed largest magnitude positive or negative

ƒ Simple circuit

ƒ overflow = a3’b3’s3 + a3b3s3’
ƒ Include “overflow” output bit on adder/subtractor
sign bits
overflow
(a)
overflow
(b)
no overflow
(c)
If the numbers’ sign bits have the same value, which
differs from the result’s sign bit, overflow has occurred.

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

46 of 58

ALU

ƒ More efficient design uses ALU

ƒ ALU design not just separate components multiplexed (same problem as previous slide!),
ƒ Instead, ALU design uses single adder, plus logic in front of adder’s A and B inputs

ƒ Logic in front is called an arithmetic-logic extender

ƒ Extender modifies the A and B inputs such that desired operation will appear at output of
the adder

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 47 of 58

Arithmetic-Logic Extender in Front of ALU

ƒ xyz=000: Want S=A+B – just pass a to ia, b to ib, and set cin= ƒ xyz=001: Want S=A-B – pass a to ia, b’ to ib, and set cin= ƒ xyz=010: Want S=A+1 – pass a to ia, set ib=0, and set cin= ƒ xyz=011: Want S=A – pass a to ia, set ib=0, and set cin= ƒ xyz=1000: Want S=A AND B – set ia=a*b, b=0, and cin= ƒ others: likewise

ƒ Based on above, create logic for ia(x,y,z,a,b) and ib(x,y,z,a,b) for each abext, and create logic for cin(x,y,z), to complete design of the AL-extender component

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 48 of 58

ALU Example: Multifunction Calculator

ƒ Design using ALU is elegant and efficient

ƒ No mass of wires
ƒ No big waste of power

8-bit register

ALU S

CALC

e

z

y x

clk

ld

z

y x

8

8

8

8 A A

B B

DIP switches 1 0

1 0

LEDs

1 0

8-bit register

8-bit 8x1 mux

CALC

e

z

y x

clk

Id

s s s 0 1 2 3 4 5 6 7

  • Ð +1 ANDORXORNOT

8 8

8 (^8 )

8

8

(^8 8 )

8 8

A B

A lot of wi res.

Wasted power

DIP switches 1 0

1 0

LEDs

1 0

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

49 of 58

omthecar's

ompu

er

otheab ordispl

C

d

d

d

d e

i

i

i

i

i

a

a

load

i

2 ⋅^4

Frcen tr al

c

t

d D

x y

s1 s

8-bit 4 × 1

T

ov e

mi rr

ay

load

load

load

load

reg

reg

reg

reg

T
A
I
M

Register Files

ƒ MxN register file component

provides efficient access to M

N-bit-wide registers

ƒ If we have many registers but
only need access one or two at
a time, a register file is more
efficient
ƒ Ex: Above-mirror display
(earlier example), but this time
having 16 32-bit registers

ƒ Too many wires, and big mux is too slow

Fr

omthecar

?^ s

ce

nt ral

c

tompu

er

T

otheab

ov e-

mi rr

ordispl

ay

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 50 of 58

omthecar's

ompu

er

otheab ordispl

Register Files

ƒ MxN register file component

provides efficient access to M

N-bit-wide registers

ƒ If we have many registers but
only need access one or two at
a time, a register file is more
efficient
ƒ Ex: Above-mirror display
(earlier example), but this time
having 16 32-bit registers

ƒ Too many wires, and big mux is too slow

Fr

omthecar

?^ s

ce

nt ral

c

tompu

er

T

otheab

o ve

mi rr

ordispl

ay

C

d

d e

i

i load

i3-i

d D

s3-s

32-bit 16 x 1

load

load

reg

reg

congestion

too much fanout

huge mux

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky 51 of 58

Register File

ƒ Instead, want component that has one data input and one data output, and allows us to

specify which internal register to write and which to read

W_data W_addr

W_en

R_data R_addr

R_en 16 × 32 register file

a

a

Digital Design Copyright © 2006 Frank Vahid

ECE 474a/575a Susan Lysecky

55 of 58

Chapter Summary

ƒ Need datapath components to store and operate on multibit data

ƒ Also known as register-transfer-level (RTL) components

ƒ Components introduced

ƒ Registers
ƒ Shifters
ƒ Adders
ƒ Comparators
ƒ Counters
ƒ Multipliers
ƒ Subtractors
ƒ Arithmetic-Logic Units
ƒ Register Files

ƒ Next, we’ll combine knowledge of combinational logic design, sequential logic

design, and datapath components, to build digital circuits that can perform general

and powerful computations