Escolar Documentos
Profissional Documentos
Cultura Documentos
Chapter 5 <1>
Chapter 5 :: Topics
Introduction
Arithmetic Circuits
Number Systems
Sequential Building Blocks
Memory Arrays
Logic Arrays
Chapter 5 <2>
Multipliers
Partial products formed by multiplying a single
digit of the multiplier with multiplicand
Shifted partial products summed to form result
Decimal
230
x 42
460
+ 920
9660
Binary
multiplicand
multiplier
partial
products
result
230 x 42 = 9660
0101
x 0111
0101
0101
0101
+ 0000
0100011
5 x 7 = 35
Chapter 5 <3>
4 x 4 Multiplier
A B
4
x
8
P
A3
A2
B0
B1
A3
B3
A2
B2
A1
B1
A0
B0
A1
A0
0
0
B2
B3
+
P7
P6
P5
P4
P3
P2
P1
P0
P7
P6
P5
P4
P3
Chapter 5 <4>
P2
P1
P0
Counters
Increments on each clock edge
Used to cycle through numbers. For example,
000, 001, 010, 011, 100, 101, 110, 111, 000, 001
Example uses:
Digital clock displays
Program counter: keeps track of current instruction executing
Symbol
Implementation
CLK
CLK
Q
Reset
Reset
Chapter 5 <5>
Counters
Counters are very often need inside the
system, for instance to measure time.
+4
PC
Clk
Process(clk)
Begin
if rising_edge(clk) then
PC <= PC + to_unsigned(4,32);
End if;
End process;
12
16
20
Shift Registers
Shift a new bit in on each clock edge
Shift a bit out on each clock edge
Serial-to-parallel converter: converts serial input (Sin) to
parallel output (Q0:N-1)
Symbol:
Implementation:
CLK
Q
S in S out
S in
S out
Q0
Q1
Q2
Chapter 5 <8>
Q N-1
D1
D2
DN-1
Q0
Q1
Q2
Chapter 5 <9>
S out
Q N-1
Memory Arrays
Efficiently store large amounts of data
3 common types:
Dynamic random access memory (DRAM)
Static random access memory (SRAM)
Read only memory (ROM)
Address
Array
Data
Chapter 5 <10>
Memory Arrays
2-dimensional array of bit cells
Each bit cell stores one bit
N address bits and M data bits:
Address
Address
Array
Data
11
0 1 0
10
1 0 0
01
1 1 0
00
0 1 1
Array
Data
Address Data
2
depth
width
Chapter 5 <11>
22 3-bit array
Number of words: 4
Word size: 3-bits
For example, the 3-bit word stored at address 10 is 100
Address Data
Address
Array
Data
11
0 1 0
10
1 0 0
01
1 1 0
00
0 1 1
depth
width
Chapter 5 <12>
Memory Arrays
Address
10
1024-word x
32-bit
Array
32
Data
Chapter 5 <13>
Chapter 5 <14>
Memory Array
Wordline:
like an enable
single row in memory array read/written
corresponds to unique address
only one wordline HIGH at once
2:4
Decoder
11
Address
10
01
00
bitline2
wordline3
wordline2
wordline1
wordline0
bitline1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
Data2
Data1
Chapter 5 <15>
bitline0
Data 0
Types of Memory
Random access memory (RAM): volatile
Read only memory (ROM): nonvolatile
Chapter 5 <16>
Chapter 5 <17>
Types of RAM
DRAM (Dynamic random access memory)
SRAM (Static random access memory)
Differ in how they store data:
DRAM uses a capacitor
SRAM uses cross-coupled inverters
Chapter 5 <19>
Chapter 5 <20>
DRAM
Data bits stored on capacitor
Dynamic because the value needs to be refreshed
(rewritten) periodically and after read:
Charge leakage from the capacitor degrades the value
Reading destroys the stored value
bitline
wordline
stored
bit
Chapter 5 <21>
DRAM
bitline
wordline
stored + +
bit = 1
bitline
wordline
stored
bit = 0
Chapter 5 <22>
SRAM
bitline
bitline
wordline
Chapter 5 <23>
wordline3
10
01
00
bitline2
wordline2
wordline1
wordline0
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
Data2
bitline1
bitline0
Data1
Data0
bitline
wordline
Chapter 5 <24>
Chapter 5 <25>
Chapter 5 <26>
ROM Storage
Address Data
11
0 1 0
10
1 0 0
01
1 1 0
00
0 1 1
width
Chapter 5 <27>
depth
ROM Logic
Data2 = A1 A0
Data1 = A1 + A0
Data0 = A1A0
Chapter 5 <28>
2:4
Decoder
11
A, B
10
01
00
X
Chapter 5 <29>
2:4
Decoder
11
A, B
10
01
00
X
Chapter 5 <30>
10
01
00
bitline2
wordline3
wordline2
wordline1
wordline0
bitline1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
Data2
Data1
Data2 = A1 A0
Data1 = A1 + A0
Data0 = A1A0
Chapter 5 <31>
bitline0
Data0
Chapter 5 <32>
2:4
Decoder
11
wordline3
10
01
00
bitline2
wordline2
wordline1
wordline0
bitline1
stored
bit = 1
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 1
stored
bit = 1
stored
bit = 0
stored
bit = 1
stored
bit = 0
stored
bit = 0
stored
bit = 0
stored
bit = 0
Chapter 5 <33>
bitline0
Truth
Table
A
0
0
1
1
B
0
1
0
1
Y
0
0
0
1
A1
A0
bitline
01
stored
bit = 0
stored
bit = 0
10
stored
bit = 0
11
stored
bit = 1
Y
Chapter 5 <34>