Combinational Circuits
Decoder Decoder : Takes n inputs Selects one of 2n output lines
Truth Table Expression for each output has one term O0 = I1' I0' O1 = I1 I0' O2 = I1' I0 O3 = I1 I0
Decoder Implementation O0 = I1' I0' O1 = I1 I0' O2 = I1' I0 O3 = I1 I0
Sample Use 3 8 decoder used to pick instruction
Multiplexer Multiplexer : 2 input multiplexer 4 input multiplexer N data lines lines Log2(N) select lines 2 input multiplexer 4 input multiplexer
Decode to Mux Multiplexer selection same as decoder 4 input multiplexer
Shifter 1 bit shifter D4 goes to either S3 or S5
Shifter 1 bit shifter If C = 1, goes to S5
Shifter 1 bit shifter If C = 0, goes to S3
Shifter S = direction 0: left, 1: right Logical shift: Left bit always 0 on right shift
Multibit Shift 4 bit wide 0-3bit shift S selects direction Multiplexers select correct pattern
Priority Only keep most significant bit
Half Adder Half Adder : adds A + B, produce sum + carry 1 1 1
Half Adder Truth Table Inputs a & b Carry : c Sum : s
First Pass
XOR Function XOR gate : exclusive OR Notation: A B OR A ^ B AB' + A'B Notation: A B OR A ^ B
Using XOR Half Adder Final
Full Adder 1 1 1 Full Adder handles carry in Three inputs: Cin, A, B Two out: Cout, S 1 1 1
Full Adder Circuit Made from two half adders Add A & B Add sum to carry
Full Adder Abstracted
Ripple Carry Adder Multibit adder : string of 1 bit full adders
Ripple Carry Adder Implemented with carry out & signed overflow:
Ripple Carry Adder Adding subtraction to adder Select line 0 : Normal 1 : Invert one pattern, add extra 1 via carry
Ripple Carry Adder Carry signal needs to propagate from one adder to next 3 gates delay per bit
Carry Select Cary Select Adder Calculate second block with both 0 and 1 carry Work in parallel with first Pick right answer when carry available
ALU ALU : Arithmetic Logic Unit In: Out: 2 Operands Control signal Result based on select operation
1-Bit Simple ALU Processes two 1-bit inputs A, B 4 functions: AND, NOT, OR, Add
4-Bit Simple ALU Four 1-bit ALU's chained together
ALU More function select bits = more operations 3 bits = up to 8 ops