CS220 Lecture 07 and 08 (3)
CS220 Lecture 07 and 08 (3)
Recap
Understand how positive and negative integers may be encoded in binary.
Understand how a 1-bit adder circuit can be designed, how larger adders can
be composed of smaller units and how subtraction can be done on an adder
using two’s complement arithmetic.
CS220 Computer Architecture
Digital Logic Design
In Today’s Class
Making larger adder circuits faster – the carry lookahead adder
While the sum value for each bit position can be calculated in
parallel, we need an accelerated way of generating the carry to
overcome the serial performance limitations of the ripple carry
design.
CS220 Computer Architecture
Digital Logic Design
NOTE: c-outi-1 = c-ini (The carry out from a previous bit position is
CS220 Computer Architecture
Digital Logic Design
c-out0 = G0 + P0.c-in0
c-out1 = G1 + P1.(G0 + P0.c-in0) = G1 + P1G0 + P1P0.c-in0
c-out2 = G2 + P2G1 + P2P1G0 + P2P1P0.c-in0
c-out3 = G3 + P3G2+ P3P2G1 + P3P2P1G0 + P3P2P1P0.c-in0
sum_out0 = A0 B0 c_in0
sum_out1 = A1 B1 c_in1
sum_out2 = A2 B2 c_in2
sum_out3 = A3 B3 c_in3
CS220 Computer Architecture
Digital Logic Design
sum_out0 = A0 B0 c_in0
sum_out1 = A1 B1 c_in1
sum_out2 = A2 B2 c_in2
sum_out3 = A3 B3 c_in3
CS220 Computer Architecture
Digital Logic Design
By putting all the stages of the circuit together, you can see that
the critical path through the circuit involves four gate delays
before the complete sum of the four-bit numbers A+B is
calculated.
Data Transmission
The wired exchange of data between two digital systems
requires a pair of wires to create a signalling path between the
two communicating points. Bits are signalled by voltage changes
between the wire pairs over a period of time. Ground
0 1 1 0 1
Data Signal
Data Transmission
Data in digital systems is sometimes processed and transmitted
in parallel. As an example, consider flat ribbon cables connecting
equipment like hard disks with motherboards over a short
distance. There are multiple pairs of wires acting as signal paths
to enable multiple bits to be transmitted simultaneously from
one point to another.
Ground
0 1 1 0 1
Data Signal
CS220 Computer Architecture
Digital Logic Design
Multiplexing
One of the techniques that can be employed for reducing the
number of connections between devices that need to
communicate is known as multiplexing.
Multiplexers
To save on the interconnection cost of multiple simple
components, a Multiplexer is a device which connects a number
of inputs to share a single output in time. It selects 1 of the n
input channels and routes it to the output depending on the
value placed on the control inputs.
CS220 Computer Architecture
Digital Logic Design
Multiplexers
Internal Schematic
CS220 Computer Architecture
Digital Logic Design
Multiplexing Applications
A multiplexer can be used to share a single wire connection
between data sources and where they are collected/sent and
processed, saving interconnection costs, no network protocols or
contention hardware required.
CS220 Computer Architecture
Digital Logic Design
Demultiplexer
A demultiplexer performs the opposite function to a multiplexer.
A demultiplexer sends input data to one of its n outputs,
selected by values placed on the control inputs. An application
might involve the control of a number of devices from a remote
distance using a single transmission line with a demultiplexer
circuit on the end.
CS220 Computer Architecture
Digital Logic Design
Demultiplexer
The internal schematic of a 4-to-1 line Demultiplexer is given
below:-
CS220 Computer Architecture
Digital Logic Design
Telecommunications Applications
Multiplexer combining multiple inputs into a single data stream
for transmission. On the receiving side, a demultiplexer splits the
single data stream into the original multiple signals.
CS220 Computer Architecture
Digital Logic Design
Multiplexer Applications
Multiplexers can be used to implement switching functions.
Consider the Full Carry Output from a 1-bit Full-Adder (i.e. A
three variable switching function).
CS220 Computer Architecture
Digital Logic Design
Multiplexer Applications
Note that this implementation is less efficient (8x4-input AND
and 1x8 input OR) in terms of overall numbers of gates than our
earlier circuit constructed from simple gates.
CS220 Computer Architecture
Digital Logic Design
Multiplexer Applications
We could also implement the Full Carry function using a 4-1
Multiplexer.
CS220 Computer Architecture
Digital Logic Design
Tri-State Buffers
A buffer is a logic device whose main purpose is to amplify or
drive output lines when interfacing with other devices. It
provides the necessary current and voltage required by the
interface. In addition, a tri-state buffer provides the ability to
disconnect an output from a shared circuit such as a bus system.
Tri-State Buffers
Different types of tri-state buffers are described by the symbols
below. The tri-state buffer output may be enabled by an active
high signal (left) or by an active low signal(right) depending on its
type.
Tri-State Buffers
The ability to ‘disconnect’ a circuit output is important when two
or more outputs are sharing a connection to another system
such as a bus.
A bus is a shared set of communication lines and controlling logic
that interconnects subsystem components in a computer system.
Decoders
A decoder translates a binary input to a spatial location, i.e. one
of its 2n outputs is selected and activated depending on the value
placed on its n control inputs.
Decoders
The Internal Schematic of a 1-of-4 decoder with an enable line
might look as follows:-
CS220 Computer Architecture
Digital Logic Design
Decoders
Decoders may be used to select and enable other circuits. For
example, A and B could represent part of a memory address. The
output of the decoder could be used to select and activate the
appropriate memory device or to choose a row or column of
cells out of a memory device.
CS220 Computer Architecture
Digital Logic Design
Decoders
2^32 bit address = 4 GigaBytes of memory space
CS220 Computer Architecture
Digital Logic Design
Decoders
4 GBytes of DRAM organised as 4x1GByte devices.
2^32 memory locations. ¼ of address space in each module.
CS220 Computer Architecture
Digital Logic Design
Decoders
The decoder may also be regarded as a minterm generator. Each
output generates one minterm (a product of the control inputs A
and B). By combining the appropriate outputs from the decoder
using an OR gate, you can implement a switching function.
CS220 Computer Architecture
Digital Logic Design
CS220 Computer Architecture
Digital Logic Design
Encoders
Encoders translate a set of inputs into a binary encoding.
If one of the A inputs below is active, the F output represents its
appropriate binary code in the range 0..3.
Encoder
CS220 Computer Architecture
Digital Logic Design
Encoders
One example application of an encoder might be in fielding
interrupts from various devices connected to the inputs and
then using the outputs to communicate the interrupt number
that has occurred using fewer communication lines for the
signals.
CS220 Computer Architecture
Digital Logic Design
Encoders
Internal Schematic of 4 to 1 Encoder
F0 = A1 + A3
F1 = A2 + A3
Encoder
CS220 Computer Architecture
Digital Logic Design
Encoders
Note that this arrangement doesn’t differentiate between device
A0 and no device signalling. Could ignore connection A0.
Encoder
CS220 Computer Architecture
Digital Logic Design
Encoders
What if more than one encoder input was active at the same
time?
Solution: Design the encoder so that the output corresponds
with the number of the highest priority device.
Encoder
CS220 Computer Architecture
Digital Logic Design
Encoders
Priority Encoder Design
CS220 Computer Architecture
Digital Logic Design
Encoders
Priority Encoder Design
F1 = A3+A3’.A2 = A3 + A2
F0 = A3 + A3’.A2’.A1 = A3 + A2’.A1
NR = A3’.A2’.A1’.A0’
CS220 Computer Architecture
Digital Logic Design
Encoders
Priority Encoder Design
F1 = A3+A3’.A2 = A3 + A2
F0 = A3 + A3’.A2’.A1 = A3 + A2’.A1
NR = A3’.A2’.A1’.A0’