Title: L1516
1Digital Logic
- L15-16
- Guilin Wang
- School of Computer Science
- The University of Birmingham
- adapted from Ata Kaban
2Topics for This Lecture
- Gates and Boolean logic
- AND, OR, NOT, NAND, NOR
- Integrated circuits
- SSI, MSI, LSI, VLSI
- Memory
- Flip-Flop
- Arithmetic circuits
- Half-adder, Full-adder, ALU
3Basics of Hardware Design
- Components of a computer
- CPU ALU, adder, multiplier, instruction
controller, data path, - Memories registers, cache, main memory,
- I/O devices
- buses
- The lowest logical design level
- Digital circuits are built from gates
- gates were built from transistors
- Device level (physics)
- N/P-type semiconductors (transistors)
4Digital Circuits
- In a digital circuit, only two logical values are
present 0 or 1. - continuous voltage range (within bounds)
- 0 is low signal (voltage range 0 to 1)
- 1 is high signal (voltage range 2 to 5)
- Gates
- electronic devices that compute functions of 0/1
- made from transistors (very fast small switches)
5How a Transistor Works
- - If Vin lt Vcv, no current flows through So,
Vout is high. - If Vin gt Vcv, current flows through So, Vout is
low. - As input signal is inverted, this forms a NOT
gate.
6The Three Main Gates
Truth Table A, B inputs X output X f(A,B)
NOT invert (negate) single input. AND 1
only if both inputs 1 OR 1 if at least one
input 1
7Two More Gates
NAND Output 0 only if both inputs 1 (inverted
AND) NOR Output 0 if at least one input
1(inverted OR)
Simpler - 2 instead of 3 transistors...
8Boolean Algebra
- A Boolean function can have N variables, eg.
- M f (A, B, C).
- Write
- AB for A AND B
- AB for A OR B
- for NOT A
- Write functions as as a sum of product terms, e.g
- M BC A C AB ABC (majority vote).
- Such a formula leads directly to a possible
circuit implementation.
9Boolean Algebra
- A circuit for majority function of three
variables.
10Boolean Algebra
- Some identities of Boolean algebra.
11Circuit Equivalence
- Different circuits may implement the same
function. - 3 circuits for XOR (eXclusive OR)
12Circuit Equivalence
- Circuit designers often try to reduce the number
of gates in their products. - AND, OR, NOT gates are enough to implement any
Boolean function. - NAND itself has the above property. So, we say
NAND is complete. - NOR is also complete.
- How to prove the above statements?
13Circuit Equivalence
- For example, we can construct AND and OR gates
using NAND gate as follows
- Exercises
- Can you do NOT?
- How to construct AND, OR, and NOT gates from NOR
gate?
14Integrated Circuits (chips)
SSI chip 5mm x 5mm Standardised Pins
Classification based on number of gates Small
Scale Integrated (SSI) circuit 1-10 gates Medium
Scale Integrated (MSI) circuit 10-100
gates Large Scale Integrated (LSI) circuit
100-100,000 gates Very Large Scale Integrated
(VLSI) circuit gt 100,000 gates
15Types of Chips
- Combinational circuits
- Boolean functions, transform inputs to output
- Control circuits
- data buses, clocks, etc
- Memories
- can store bits contain feedback
- Flip-Flop
- Arithmetic circuits
- Half-adder, Full-adder, ALU
16Clock Signals
- Clock signals are used to provide synchronization
among events. - Clock is a circuit that emits a series of pulses
with a precise pulse width and precise interval
btw consecutive pulses. - This precise time interval is called clock cycle
time. - Pulse frequencies 1 to 500 MHz.
- Clock cycles 1000 to 2 nsec.
- The clock frequency is usually controlled by a
crystal oscillator.
17Clock Signals
- Some events may happen during one single clock
cycle and in a specific order. - In such cases, the clock cycle must be divided
into subcycles. - A common way is to get a phase-shifted clock
signal from the primary. - The example below provides four time references,
i.e., rising (falling) edge of C1 (C2).
18The Flip-Flop
- A bistable device (also called a clocked D latch)
- Has inputs D and clock signal, and output Q
- When control is on, Q D
- When control is off, output is always available
but cannot change. Hence, one bit value D is
stored.
19Memories
- Registers
- N-bit flip-flop gives N-bit register
- N bits one word
- Memories
- M registers gives M-word memory
20Memories
- Logic diagram for a 4x3 memory
- (Book 2, p166)
- 8 input lines
- - Data I0, I1, I2
- - Address A0, A1
- - Control CS, RD, OE
- 3 output lines D0, D1, D2
- Function
- - Write 3 bits into a selected word or
- - Read 3 bits from a selected word.
21Arithmetic Circuits
- Addition
- 1-bit addition yields 1-bit result and 1-bit
carry - 0 0 0
- 0 1 1
- 1 0 1
- 1 1 0 carry 1
- Adders
- half-adder 1-bit adder with 2 bit input
- full-adder 1-bit adder with additional carry
input - N-bit adder requires N full-adders
22Half-adder
- 2 bits on input
- 1 bit sum plus 1 bit carry on output
- Half-adder cannot handle carry in the middle of
the word...
23Full-adder
- 2 bits and carry on input
- 1 bit sum plus 1 bit carry on output
- Built from two half-adders
- N-bit adder can be built from this 1-bit full
adder. However, there is an ripple effect. - How to get faster adder without such a delay?
24Arithmetic Logic Units (ALU)
25Arithmetic Logic Units (ALU)
- The above 1-bit ALU can perform any of the
following operations A AND B, A OR B, , AB. - This depends on the values of the function-select
inputs F0 and F1 , i.e., 00, 01, 10, or 11. - An 8-bit ALU can be built up from eight 1-bit ALU
slices.
(For simplicity, the enables and invert signals
are not shown.)
26Summary
- We have discussed
- Boolean function, gates
- Flip-flop, memories
- Adder, ALU
- Further topics
- How to use data buses transferring data/control
info along wires, one wire per bit. - How to use control signals (clocks) avoiding
conflicts.