Professional Documents
Culture Documents
Binary Adder/Subtractor: KU College of Engineering Elec 204: Digital Systems Design
Binary Adder/Subtractor: KU College of Engineering Elec 204: Digital Systems Design
Lecture
11 of Engineering
KU College
Overflow
When does it occur?
How do we detect it?
Lecture
11 of Engineering
KU College
01110
+5
0101
+7
0111
+12 ? 01100
10000
-4
1100
-6
1010
-10 ? 10110
Binary Multiplication
The binary digit multiplication table is trivial:
(a b)
b=0
b=1
a=0
a=1
Lecture
11 of Engineering
KU College
columns may
(a0 b1) (a0 b0)
generate carries.
+
(a1 b1) (a1 b0)
P3
P2
P1
P0
Lecture
11 of Engineering
KU College
An implementation of
the 2 2 multiplier
array is shown:
Lecture
11 of Engineering
KU College
Lecture
11 of Engineering
KU College
Design by Contraction
Contraction is a technique for simplifying the
logic in a functional block to implement a
different function
The new function must be realizable from the original
function by applying rudimentary functions to its inputs
Contraction is treated here only for application of 0s
and 1s (not for X and X)
After application of 0s and 1s, equations or the logic
diagram are simplified
Lecture
11 of Engineering
KU College
A1
0
C3 5 X
C1
S2
A0
1
2
3
C0 5 0
S1
A2
S2
A1
S1
A0
S0
(b)
Lecture
11 of Engineering
KU College
10
Decrementing
Lecture
11 of Engineering
KU College
11
Storage
Elements
Combinational
Logic
State
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.
Lecture
11 of Engineering
KU College
Outputs
Next
State
12
Combinatorial Logic
Next state function
Storage
Elements
Combinational
Logic
Outputs
Next
State
State
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
Lecture
11 of Engineering
KU College
13
Synchronous
Behavior defined from knowledge of its signals at discrete instances of
time
Storage elements observe inputs and can change state only in relation to a
timing signal (clock pulses from a clock)
Asynchronous
Behavior defined from knowledge of inputs an any instant of time and the
order in continuous time in which inputs change
If clock just regarded as another input, all circuits are asynchronous!
Nevertheless, the synchronous abstraction makes complex designs
tractable!
Lecture
11 of Engineering
KU College
14
Lecture
11 of Engineering
KU College
15
t (ns) A
B
1
1
0
1 0 1
0 1
0.5
0.8 1 0 1
0.13
F(I)
0
1 0
F
Comment
0
A=B=1 for a long time
0
F(I) changes to 1
1 0 F changes to 1 after a 0.5 ns delay
1
F(Instantaneous) changes to 0
1 0 1
0 1 0 F changes to 0 after a 0.5 ns delay
Lecture
11 of Engineering
KU College
16
0.2
Lecture
11 of Engineering
KU College
0.4
0.5
17
Y = A for S = 0
Y = B for S = 1
2-input multiplexer:
0.2
S
B
0.4
0.5
0.4
A
B
S
S
Y
Lecture
11 of Engineering
KU College
18
Storing State
What if A connected to Y?
Circuit becomes:
With function:
0.2
Y = B for S = 1, and
Y(t) dependent on
Y(t 0.9) for S = 0
S
B
0.4
0.5
0.4
The simple combinational circuit has now become a sequential circuit because its output is a function of a time sequence of input signals!
B
S
S
Y
Lecture
11 of Engineering
KU College
19
Time
B
1
1
1
0
0
0
1
S
0
1
0
0
1
0
0
Y
0
1
1
1
0
0
0
Comment
Y remembers 0
Y = B when S = 1
Now Y remembers B = 1 for S = 0
No change in Y when B changes
Y = B when S = 1
Y remembers B = 0 for S = 0
No change in Y when B changes
Lecture
11 of Engineering
KU College
20
0.2
0.5
S
B
The following behavior results:
The circuit is said
B
to be unstable.
0
For S = 0, the
1
circuit has become
1
what is called an
1
oscillator. Can be
1
used as crude clock.
1
Lecture
11 of Engineering
KU College
0.2
Suppose we place
an inverter in the
feedback path.
0.4
S
1
1
0
0
0
0
Y
0
1
1
0
1
0
Comment
Y = B when S = 1
Now Y remembers A
Y, 1.1 ns later
Y, 1.1 ns later
Y, 1.1 ns later
21
S (set)
R (reset)
Time R S Q Q Comment
S = 0, R = 0 is
forbidden as
input pattern
Lecture
11 of Engineering
KU College
1
1
1
0
1
0
1
1
0
1
1
1
0
1
?
1
1
0
0
1
?
?
0
0
1
1
1
?
Lecture
11 of Engineering
KU College
S
0
1
0
0
0
1
0
Q
?
1
1
0
0
0
?
Q
?
0
0
1
1
0
?
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!
23