Professional Documents
Culture Documents
Three-state logic adds a third logic value, HiImpedance (Hi-Z), giving three states: 0, 1, and Hi-Z on the outputs. The presence of a Hi-Z state makes a gate output as described above behave quite differently:
1 and 0 become 1, 0, and Hi-Z cannot becomes can, and only one becomes two
Chapter 2 - Part 3 1
Hi-Z may appear on the output of any gate, but we restrict gates to:
a 3-state buffer, or Optional: a transmission gate (See Reading Supplement: More on CMOS Circuit-Level Design),
each of which has one data input and one control input.
Chapter 2 - Part 3
Chapter 2 - Part 3
1 1 0 X 1 IN1 EN1 0 X 0 X X Since EN0 = S and EN1 = S, one of the two buffer outputs is always Hi-Z plus the last row of the table never occurs.
Chapter 2 - Part 3
Decoding
Decoding - the conversion of an n-bit input code to an m-bit output code with n em e 2n such that each valid code word produces a unique output code Circuits that perform decoding are called decoders Here, functional blocks for decoding are
called n-to-m line decoders, where m e 2n, and generate 2n (or fewer) minterms for the n input variables
Chapter 3 6
Decoder Examples
1-to-2-Line Decoder
A 0 1 D0 D1 D0 = A 1 0 (a) 0 1 A (b) D1 = A
2-to-4-Line Decoder
A0 A1 A0 0 0 1 1 0 1 0 1 D0 D 1 D2 D3 A1 1 0 0 0 (a) 0 1 0 0 0 0 1 0 0 0 0 1
D0 = A 1 A 0 D1 = A 1 A 0 D2 = A 1 A 0 D3 = A 1 A 0 (b)
Decoder Expansion
General procedure given in book for any decoder with n inputs and 2n outputs. This procedure builds a decoder backward from the outputs. The output AND gates are driven by two decoders with their numbers of inputs either equal or differing by 1. These decoders are then designed using the same procedure until 2-to-1-line decoders are reached. The procedure can be modified to apply to decoders with the number of outputs 2n
Chapter 3 8
2-to-4-line decoder
Number of output ANDs = 4 Number of inputs to decoders driving output ANDs = 2 Closest possible split to equal
Two 1-to-2-line decoders
Result
A0
D0
D1
A1
D2 2-to-4-Line decoder
D3 D4
A2
D5 1-to-2-Line decoders D6 D7
Chapter 3 10
4-to-16-line decoder
Number of output ANDs = 16 Number of inputs to decoders driving output ANDs = 2 Closest possible split to equal
2 2-to-4-line decoders
Alternatively, can be viewed as distributing value of signal EN to EN 1 of 4 outputs A In this case, called a A demultiplexer D
1 0 0
EN A 1 A 0 0 1 1 1 1
Chapter 3 12
D0 D1 D2 D3 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
D1
X 0 0 1 1
X 0 1 0 1
D2
D3 (b)
(a)
Encoding
Encoding - the opposite of decoding - the conversion of m discrete inputs to a n-bit output code with n em e 2n such that each of the inputs produces a unique output code Circuits that perform encoding are called encoders An encoder has 2n (or fewer) input lines and n output lines which generate the binary code corresponding to the input values Typically, an encoder converts a code containing exactly one bit that is 1 to a binary code corres-ponding to the position in which the 1 appears. Two types - inputs mutually exclusive or not
Chapter 3 13
Encoder Example
A decimal-to-excess 3 BCD encoder
Inputs: 10 bits corresponding to decimal digits 0 through 9, (D0, , D9) Outputs: 4 bits with excess 3 BCD codes Function: If input bit Di is a 1, then the output (A3, A2, A1, A0) is the excess 3 BCD code for i D i A3 A2 A1 A0 0 1 2 3 4 5 6 7 8 9 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0
Chapter 3 14
Note that if none of the inputs are asserted the output = "0000" (invalid excess 3 code)
Chapter 3 15
Selecting
Selecting of data or information is a critical function in digital systems and computers Circuits that perform selecting have:
A set of inputs from which the selection is made A single output A set of control lines for making the selection
Logic circuits that perform selecting are called multiplexers Selecting can also be done by three-state logic or transmission gates
Chapter 3 16
Multiplexers
A multiplexer selects information from an input line and directs the information to the output line A typical multiplexer has n control inputs (Sn 1, S0) called selection inputs, 2n information inputs (I2n 1, I0), and one output Y A multiplexer can be designed to have m information inputs with m 2n as well as n selection inputs
Chapter 3 17
2-to-1-Line Multiplexer
Since 2 = 21, n = 1 The single selection variable S has two values:
S = 0 selects input I0 S = 1 selects input I1
Decoder
I0
Enabling Circuit
I1
Chapter 3 18
To obtain a basis for multiplexer expansion, we combine the Enabling circuits and OR gate into a 2 v 2 AND-OR circuit:
1-to-2-line decoder 2 v 2 AND-OR
Decoder 4 X2 AND-OR I0 I1 I2 I3
Y
Chapter 3 20
. . .
Y0
I 3,0
43
AN
OR
A0
. . .
. . .
A1
Chapter 3 21
I 3,
I 0,
Y1
43 I 0,2 . . .
AN
OR Y2
I 3,2
I 0,3 . . . I 3,3
43
AN
OR
Y3
I0
I1
1
I2
I3
(b) Gate input cost = 14 compared to 22 (or 18) for gate implementation
Chapter 3 22
A half adder adds two bits to produce a two-bit sum X Y C S The sum is expressed as a sum bit 0 0 0 0 , S and a carry bit, C 0 1 0 1 The half adder can be specified as a 1 0 0 1 truth table for S and C 1 1 1 0
Chapter 4 24
Y
0 1
11
3
S ! X Y X Y ! X Y S ! (X Y ) (X Y )
and
12
13
C ! X Y C ! ( ( X Y ) )
(d) S ! ( X Y ) C ( a) S ! X Y X Y C ! (X Y ) C ! X Y ( b ) S ! ( X Y ) ( X Y ) ( e) S ! X Y C ! X Y C ! X Y (c) S ! (C X Y ) (a),C ! and Y are SOP, POS, and XOR implementations (b), X (e)
for S. In (c), the C function is used as a term in the AND-NOR implementation of S, and in (d), the function is used in a C POS term for S.
Chapter 4 26
Implementations: Half-Adder
The most common half implementation is:
X Y
adder (e)
S C
S ! X Y C ! X Y
A NAND only implementation is:
C S
S ! (X Y ) C C ! ( ( X Y ) )
Chapter 4 27
0 1 +1 10 1 1 +1 11
00 1 0 +0 01
01 1 0 +1 10
01 1 1 +0 10
Full-Adder K-Map:
S Y
Z 0 1 0 1 0 1 0 1
C 0 0 0 1 0 1 1 1
S 0 1 1 0 1 0 0 1
1
0 1 3
1
2 0 1 5
1
3 2 6
14
17
15 17 16
Z
Z
Chapter 4 29
Ai Bi Gi
Pi
Ci
Si
Binary Adders
To add multiple operands, we bundle logical signals together into vectors and use functional blocks that operate on the vectors
Description Carry In Augend Addend Sum Carry out
Example: 4-bit ripple carry adder: Adds input vectors A(3:0) and B(3:0) to get a sum vector S(3:0) Note: carry out of cell i becomes carry in of cell i+1
Name Ci Ai Bi Si Ci+1
Chapter 4 31
B2
B1
C3
C2
C1
S3
S2
S1
Chapter 4 32
Complements
Two complements:
Diminished Radix Complement of N
(r 1) s complement for radix r 1 s complement for radix 2 Defined as (rn
2
Radix Complement
r s complement for radix r 2 s complement in binary Defined as rn N
Subtraction is done by adding the complement of the subtrahend If the result is negative, takes its 2 s complement
Chapter 4 33
2 s Complement Example:
10010100 Copy underlined bits: 100 and complement bits to the left: 01101100
Chapter 4 36
01010100 2 s comp + 10111101 00010001 The carry of 1 indicates that no correction of the result is required.
01010100 01000011
Chapter 4 38
01000011 2 s comp 10101100 + 11101111 2 s comp 00010001 The carry of 0 indicates that a correction of the result is required. Result = (00010001)
Chapter 4 39
01000011 01010100
2 s Complement Adder/Subtractor
Subtraction can be done by addition of the 2's Complement. 1. Complement each bit (1's Complement.) 2. Add 1 to the result. The circuit shown computes A + B and A B: For S = 1, subtract, the 2 s complement B A B A B A of B is formed by using B A XORs to form the 1 s comp and adding the 1 applied to C0. For S = 0, add, B is passed through C C C unchanged A FA FA FA
3 3 2 2 1 1 0
C0
C4
S3
S2
S1
S0
Chapter 4 40
Outputs
Implements a multiple-output switching function Inputs are signals from the outside. Outputs are signals to the outside. Other inputs, State or Present State, are signals from storage elements. The remaining outputs, Next State are inputs to storage elements.
Chapter 5 - Part 1 41
Next State = f(Inputs, State) Output function (Mealy) Outputs = g(Inputs, State) Output function (Moore) Outputs = h(State) Output function type depends on specification and affects the design significantly
Chapter 5 - Part 1 42
twoQ the S -R
Q
R (reset)
Time R S Q Q Comment
1 0 1 1 1 0 1 ? 1 1 0 0 1 ? ? 0 0 1 1 1 ? Stored state unknown Set Q to 1 Now Q remembers 1 Reset Q to 0 Now Q remembers 0 Both go high Unstable!
R (reset)
S (set)
Q
Comment Stored state unknown Set Q to 1 Now Q remembers 1 Reset Q to 0 Now Q remembers 0 Both go low Unstable!
1 0 0 0 1 0
Q ? 1 1 0 0 0 ?
Q ? 0 0 1 1 0 ?
Clocked S - R Latch
Adding two NAND gates to the basic S - R NAND latch gives the clocked S R latch: S Q C Q R Has a time sequence behavior similar to the basic S-R latch except that the S and R inputs are only observed when the line C is high. C means control or clock .
Chapter 5 - Part 1 45
Q(t) S 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
Comme t No cha ge Clear Q Set Q I determi ate No cha ge Clear Q Set Q I determi ate
The table describes what happens after the clock [at time (t+1)] based on:
current inputs (S,R) and current state Q(t).
Chapter 5 - Part 1 46
D Latch
Adding an inverter to the S-R Latch, C gives the D Latch: Note that there are no indeterminate states! Q(t+1) Comment Q D
0 0 1 1 0 1 0 1 0 1 0 1
D Q
Chapter 5 - Part 1 47
J-K Flip-flop
Behavior
Same as S-R flip-flop with J analogous to S and K analogous to R Except that J = K = 1 is allowed, and For J = K = 1, the flip-flop changes to the opposite state As a master-slave, has same 1s catching behavior as S-R flip-flop If the master changes to the wrong state, that state will be passed to the slave
E.g., if master falsely set by J = 1, K = 1 cannot reset it during the current clock cycle
Chapter 5 - Part 2 49
Symbol
J C K
J K
D C
Chapter 5 - Part 2 50
T Flip-flop
Behavior
Has a single input T
For T = 0, no change to state For T = 1, changes to opposite state
Same as a J-K flip-flop with J = K = T As a master-slave, has same 1s catching behavior as J-K flip-flop Cannot be initialized to a known state using the T input
Reset (asynchronous or synchronous) essential
Chapter 5 - Part 2 51
T Flip-flop (continued)
Implementation
To avoid 1s catching behavior, one solution used is to use an edge-triggered D as the core of the flip-flop
Symbol
C T D C
Chapter 5 - Part 2 52
Used in design
Excitation table - defines the flip-flop input variable values as function of the current state and next state
Chapter 5 - Part 2 53
D Flip-Flop Descriptors
Characteristic Table
D 0 1 0 1 Q(t 1) Operation Reset Set
Chapter 5 - Part 2 54
T Flip-Flop Descriptors
Characteristic TableOperation T Q(t +1)
0 1 Q(t) Q(t) No change Complement
Chapter 5 - Part 2 55
0 1 0 1
0 1 0 1
0 1 X X
X X 1 0
D C
QD
T C
QT
Chapter 5 - Part 2 58
QSR
QJK
Chapter 5 - Part 2 59
Registers
Register a collection of binary storage elements In theory, a register is sequential logic which can be defined by a state table More often, think of a register as storing a vector of binary values Frequently used to perform simple data storage and data movement and processing operations
Chapter 7 - Part 1 60
A1 I 1 D Q C A0 I 0 CP D Q C
Y1
Y0
Shift Registers
Shift Registers move data laterally within the register toward its MSB or LSB position In the simplest case, the shift register is simply a set of D flip-flops connected in a row like this:
In DQ A DQ B DQ C DQ Out
CP
Data input, In, is called a serial input or the shift right input. Data output, Out, is often called the serial output. The vector (A, B, C, Out) is called the parallel output.
Chapter 7 - Part 1 62
A DQ DQ
B DQ
C DQ
Out
In 0 1 1 0 1 1
1
A ? 0 1 1
B ? ? 0 1
C ? ? ? 0
Out ? ? ? ?
Chapter 7 - Part 1 65
Counters
Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences. Two distinct types are in common usage: Ripple Counters
Clock connected to the flip-flop clock input on the LSB bit flip-flop For all other bits, a flip-flop output is connected to the clock input, thus circuit is not truly synchronous! Output change is delayed more for each bit toward the MSB. Resurgent because of low power consumption
Synchronous Counters
Clock is directly connected to the flip-flop clock inputs Logic is used to implement the desired state sequencing
Chapter 7 - Part 2 66
Ripple Counter
How does it work?
When there is a positive edge on the clock input of A, A complements The clock input for flipflop B is the complemented output of flip-flop A When flip A changes from 1 to 0, there is a positive edge on the CP clock input of B A causing B to complement B
Chapter 7 - Part 2 67
D Clock CR
D CR Reset
Chapter 7 - Part 2 69
tPHL
A
tpHL
B C
Chapter 7 - Part 2 70
Synchronous Counters
To eliminate the "ripple" effects, use a common clock for each flip-flop and a combinational circuit to generate the next state. For an up-counter, use an incrementer =>
A3 A2 A1 A0
Incr m ter S3
S2 S1 S0
D3 Q3 D2 Q2 D1 Q1 D0 Q0
Clock
Chapter 7 - Part 2 71
XOR complements each bit AND chain causes complement of a bit if all bits toward LSB from it equal 1
D C
Q1
Count Enable
Forces all outputs of AND chain to 0 to hold the state
D
C Q2
Carry Out
Added as part of incrementer Connect to Count Enable of additional 4-bit counters to form larger counters
Clo
Chapter 7 - Part 2 72
D C
Q3
Carry chain
series of AND gates through which the carry ripples Yields long path delays Called serial gating
EN Q1
1
Q2
2
Reduces path delays Called parallel gating Like carry lookahead Lookahead can be used on COs and ENs to prevent long paths in large counters
Q3
TR 4 EN Q0 Q1 Q2 Q3 O
3
Symbol
Other Counters
See text for:
Down Counter - counts downward instead of upward Up-Down Counter - counts up or down depending on value a control
input such as Up/Down
Chapter 7 - Part 2 74
Count D0 D C Q0
D2
D C
Q2
0 1 X
Carry Output CO
0 0 1 1 1 1 0 0
1 1 0 0 1 1 0 0
0 1 0 1 0 1 0 1
Next State Q8 Q4 Q2 Q1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0
Chapter 7 - Part 2 77
0 1 0 1 0 1
1 0 1 1 0 1 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 0
8 15 7 6 5 11 13 10 4 12
2 3
Memory Definitions
Memory A collection of storage cells together with the necessary circuits to transfer information to and from them. Memory Organization the basic architectural structure of a memory in terms of how data is accessed. Random Access Memory (RAM) a memory organized such that data can be transferred to or from any cell (or collection of cells) in a time that is not dependent upon the particular cell selected. Memory Address A vector of bits that identifies a particular memory element (or collection of elements).
Chapter 8 80
Memory Data a bit or a collection of bits to be stored into or accessed from memory cells. Memory Operations operations on memory data supported by the memory unit. Typically, read and write operations over some data element (bit, byte, word, etc.).
Chapter 8 81
Memory Content
10001111 11111111 10110001 00000000 10111001 10000110 00110011 11001100
Place a valid address on the address lines and valid data on the data lines. Toggle the memory write control line
Sometimes the read or write enable line is defined as a clock with precise timing information (e.g. Read Clock, Write Strobe).
Otherwise, it is just an interface signal. Sometimes memory must acknowledge that it has completed the operation.
Chapter 8 85
Controlled by control inputs and address Timing of signal changes and data observation is critical to the operation Read timing:
Clock Address Memory enable Read/ Write Data output 65 ns
Chapter 8 86
20 ns T1
T2
T3 Address valid
T4
T1
Data valid
Read cycle
75 ns Critical times measured with respect to edges of write pulse (1-0-1): Write cycle
Address must be established at least a specified time before 1-0 and held for at least a specified time after 0-1 to avoid disturbing stored contents of other addresses Data must be established at least a specified time before 0-1 and held for at least a specified time after 0-1 to write correctly
Chapter 8 87
Chapter 8 88
Static RAM
SR Latch Select input for control Dual Rail Data Inputs B and B Dual Rail Data Outputs C and C
Cell
Array of storage cells used to implement static RAM Select Storage Cell
B C
Q RAM cell
Chapter 8 89
Data I Decoder
D3
A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out
D2
D1
S1 D0 S0
Data Out
A0 R/W
Data I
A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out A1 D-I A0 R/W CS D-Out
3210
Data Out
3210
See next slide for circuit, hydraulic analogy, and logical model.
Chapter 8 92
Stored 1
Stored 0
Write 1
(d) (e)
Write 0
D C
Read 1
Read 0
(f)
(g)
Chapter 8 93
Address
RAS
CAS
Data output
Data vali
Chapter 8 94
DRAM Types
Types to be discussed
Sync ronous DRAM (SDRAM) Double Data Rate SDRAM (DDR SDRAM) RAMBUS DRAM (RDRAM)
Chapter 8 95
Chapter 8 96