DigitalLogic ComputerOrganization L5 CombinationalLogic Handout
DigitalLogic ComputerOrganization L5 CombinationalLogic Handout
COMPUTER ORGANIZATION
Lecture 5: Combinational Building Blocks
ELEC3010
ACKNOWLEGEMENT
2
COVERED IN THIS COURSE
❑ Binary numbers and logic gates
❑ Boolean algebra and combinational logic
❑ Sequential logic and state machines
❑ Binary arithmetic
Digital logic
❑ Memories
4
EQUALITY COMPARATORS USING XOR
5
MULTIPLEXER (“MUX”)
❑ Connects one of n inputs to the output
– Select control signals pick one of the n sources
• log2n select bits
❑ Useful when multiple data sources need to be routed to a
single destination
– Often arises from resource sharing
– Example: select 1-of-n data inputs to an adder
6
2-TO-1 MUX
❑ Selects one of two inputs to appear at the output
❑ Y = S’•I0 + S•I1
7
4-TO-1 MUX
❑ Selects one of four inputs to appear at the output
8
CASCADING MULTIPLEXERS
❑ Large multiplexers can be implemented by cascading
smaller ones
9
LOGIC FUNCTIONS USING MUXES
❑ Any function of n variables can be implemented with a
2n:1 multiplexer
❑ Logic Functions Using Muxes
– Input variables connected to select inputs
– Data inputs tied to 0 or 1 according to truth table
10
LOGIC FUNCTIONS USING MUXES
❑ Can use 2n-1:1 multiplexer and at most one inverter
– Connect n-1 input variables to select inputs
– Data inputs tied to 0, 1, nth variable, or inverted nth variable
11
DECODER
❑ Binary decoders
– n inputs, 2n outputs
– Each output corresponds to a unique input value
– At most one output asserted at a time
12
2-TO-4 DECODER
13
LOGIC FUNCTIONS USING DECODERS
❑ Any function of n variables can be implemented with a n: 2n
decoder and extra gates
– Connect variables to inputs
– Appropriate minterms summed using
extra gates to form the function
14
LOGIC FUNCTIONS USING DECODERS
❑ F1 = A’B’C’D’ + AB’CD’ + ABC’D’
❑ F2 = A’B’C’ + A’B’CD
❑ F3 = A+B+C+D = (A’B’C’D’)’
15
DECODER WITH ENABLE
16
DECODER WITH ENABLE
17
ENCODERS
❑ Opposite of decoders
❑ Binary encoders: 2n inputs and n outputs
18
4-TO-2 ENCODER
❑ Exactly one input is asserted at any given time
19
PRIORITY ENCODER
❑ Highest numbered inputs have priority when multiple
inputs are asserted at the same time
❑ Example: 4-to-2 priority encoder
20
PRIORITY ENCODER
❑ Example: Microprocessor Interrupts
▪ In order for devices to get service, they interrupt
the microprocessor
▪ Most important requests are given priority
21
TRI-STATE BUFFERS
❑ Bus with tristate buffers
D3 D2 D1 D0 S1 S0
E Y
Decoder
0 Z
Z: high-impedant
1 D
22
BEFORE NEXT CLASS
23