









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










CEG/EE 260 - 2
z These slides were developed with the aid of examples found in:
z Figures many of the slides were kindly provided by:
CEG/EE 260 - 3
z What is computation? z There are many sorts of computing devices, they fall into two categories:
CEG/EE 260 - 4
z Turing’s Thesis : Computer scientists believe that ANYTHING that can be computed, can be computed by a computer (provided that it has enough time and enough memory). z What does this imply?
z Thus, any given problem is either computable or it is not computable
z We describe our problems in English or some other natural language. Computer problems are solved by electrons flowing around inside the computer. z It is necessary to transform our problem from a natural language to the voltages that influence the flow of electrons. z This transformation is really a sequence of systematic transformations, developed and improved over the last 50 years, which combine to give the computer the ability to carry out what may appear to be very complicated tasks. In reality, these tasks must be simple and straight-forward.
z General model for Engineering (Byrne, 1992)
Existing System Target System
Implementation
Design
Requirements Requirements
Con- ceptual
Con- ceptual
Design
Implementation
re-think
re-specify
re-design
re-build
Alteration
Reverse Engineering Abstraction
Forward Engineering Refinement
CEG/EE 260 - 7
Levels of abstraction in digital computation Levels of abstraction in digital computation
z Design Process
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
Software level
Hardware level
Logic level
Computer Science
Computer Engineering
Computer/Elect. Engineering
CEG/EE 260 - 8
The statement of the problem The statement of the problem
z We describe problems that we wish to solve with a computer in a “natural language.” z Natural languages are fraught with a lot of things unacceptable for providing instructions to a computer. z The most important of these unacceptable attributes is ambiguity. To infer the meaning of a sentence, a listener is often helped by context that the computer does not have. z Example: “Time flies like an arrow.”
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
CEG/EE 260 - 9
The algorithm The algorithm
z The first step in the sequence of transformations is to transform the natural language description of the problem to an algorithm. z An algorithm is a step-by-step procedure:
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
CEG/EE 260 - 10
The programming languageThe programming language
z The next step is to transform the algorithm into a computer program z Programming languages are unambiguous “mechanical” languages z There are two kinds of programming languages:
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
The instruction set architecture (ISA) The instruction set architecture (ISA)
z The next step is to translate the program into the instruction set of the particular computer that will be used to carry out the work of the program. z The Instruction Set Architecture (ISA) is the complete specification of the interface between programs that have been written and the underlying hardware that must carry out the work of those programs.
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
TheThe microarchitecturemicroarchitecture
z The next step is to transform the ISA into an implementation. The detailed organization of an implementation is called its microarchitecture.
Algorithm & Language
The Problem
ISA & Microarchitecture
Circuits & Devices
CEG/EE 260 - 19
Common Combinational SSI Logic DevicesCommon Combinational SSI Logic Devices
(Gates)(Gates)
z OR
z NOR
z AND
z NAND
z INVERTER
z BUFFER
Bubbles mean “not” Each gate has a truth table and can be represented algebraically Exercise: show that the equivalent gates do the same function CEG/EE 260 - 20
Integrated Circuits (ICs)Integrated Circuits (ICs)
z Pin-out view z Block diagram view z Functional view z Analog properties
z Integration Scale z SSI: Small Scale Integration
13
16 15
9
10
11
12
14
VCC RCO
LD
ENT
QD
QC
QB
QA
1 2
8
7
6
5
4
3
CLR CLK
GND
ENP
D
C
B
A
QB QC QD
CLR LD ENP ENT A BC D RCO
QA
CLK GND
74LS
(^1013) 12 11 15
100 KHz
6
5
(^34)
8
2
7
9
1
16 VCC
14
+5 volts
1 2 1K 3 4 5 6 9 10
8
13 12
11
74LS
CEG/EE 260 - 21
Logic Diagram Logic Diagram
z Good Design Practices include:
Wires connected
Wires not connected
A’B + AB’
A
B
A A’
B B’
B
A B’
Logic Diagram
(A’B)’ (AB’)’
CEG/EE 260 - 22
BubbleBubble--toto--Bubble Logic DesignBubble Logic Design
z Purpose : To make it easy to understand the function of the Logic circuit
/ FAIL ERROR / OVERFLOW
/ FAIL ERROR / OVERFLOW
≡
ERROR
FAIL OVERFLOW
Digital DevicesDigital Devices
z Analog characteristics
z Digital characteristics
z Digital Concepts and Devices
t
v
v
t
Electronic Aspects of Digital DesignElectronic Aspects of Digital Design
z Vin low → Ib = 0
V (^) in
V (^) out
V (^) cc Rc Rb
VOLmaxVIHminVcc
Vin
VOLmax
VOHmin
GND
Vcc
VCESat
Vout
Abnormal except for switching
V (^) OLmax: max output voltage in low state V (^) OHmin : min output voltage in high state V (^) ILmax: max input voltage recognized as low V (^) IHmin: min input voltage recognized as high
CEG/EE 260 - 25
z Digital devices are built with analog components z A range of voltages associated with each logic value ( 0 or 1 )
z Noise margin : The difference between the range boundaries
Voltage Outputs
Noise Margin Inputs
Logic 0 Logic 0
Logic 1 (^) Logic 1
Invalid
CEG/EE 260 - 26
z Logic gates Specifications :
z - Examples :
z Manufacturer specifications ( data sheets )
CEG/EE 260 - 27
z The delay time between input transitions and the output transitions due to the propagation delay of the the logic gates. z t p of a signal depends on the signal path inside the logic circuit z For a logic gate t pLH may not equal t pHL z t p is specified in the manufacturer data sheets of the IC’s z Example : -The time delay for 74x00 in nanoseconds for three logic Families: Typical Maximum t pLH t pHL t pLH t pHL 74LS00 9 10 15 15 74HCT00 11 11 35 35 74ACT00 5.5 4.0 9.5 8. z To find t p for a signal, add the propagation delays of all gates along the path of the signal
CEG/EE 260 - 28
t (^) pLH(XY) t (^) pHL(XY) t (^) rise t (^) fall
Actual Timing Diagram
Functional Timing Diagram
X
z Functional timing diagrams do not show exact delays. z “lining up” everything allows the diagram to display more clearly which functions are performed in response to which action
CEG/EE 260 - 30
z Multiple-input/multiple-output device. z Decoder - Inputs (n) < outputs (m). z Encoder - Inputs (n) > outputs (m) z Converts input code words into output code words. z One-to-One mapping :
input code
enable inputs
output DECODER code
input code
output code ENCODER
CEG/EE 260 - 37
DemultiplexersDemultiplexers
z Demultiplexer (DMUX) performs the opposite function of a MUX. z A digital Demultiplexer receives input data on a single input and transmits it on one of 2^n possible outputs according to the value of the n select inputs
z MUX/DMUX are used in data transmission
z Source Destination
MUX DMUX
A B
C
A B
C
Select Select
BUS
CEG/EE 260 - 38
Programmable Logic Devices Programmable Logic Devices
z PLDs are generic logic devices capable of implementing a wide range of combinational (and sequential) functions.
Combinational PLD
n inputs m outputs
CEG/EE 260 - 39
Why do Computers use Base 2? Why do Computers use Base 2?
z Base 10 Number Representation
1.20 = 1x10^0 + 2x10^-1 + 0x10^-
1.20 = 1x2^0 + 0x2^-1 + 0x2^-2 +…
CEG/EE 260 - 40
Unsigned Binary Integers Unsigned Binary Integers
3-bits 5-bits 8-bits
Y = “abc” = a.2 2 + b.2^1 + c.2^0
(where the digits a, b, c can each take on the values of 0 or 1 only)
Signed MagnitudeSigned Magnitude
z Leading bit is the sign bit
Y = “abc” = (-1) a^ (b.2^1 + c.2^0 )
Two’ Two’s Complements Complement
z Transformation
CEG/EE 260 - 43
z Binary to Decimal conversion & vice-versa
00001101 11111011 00001000 => 8 (as expected!)
CEG/EE 260 - 44
z Overflow
CEG/EE 260 - 45
z You’ve got to understand binary encodings.
z Examples
CEG/EE 260 - 46
int x = foo();^ •^ Is ( x+(y+z) == (x+y)+z)^ )? int y = bar(); unsigned ux = x; unsigned uy = y;
Initialization
CEG/EE 260 - 47
z ALU performs Arithmetic and Logical Functions
z Example : Inputs Functions S3 S2 S1 S0 M=0 M= 0 0 0 0 F= A-1+CIN F=A’ 0 1 1 0 F= A-B-1+CIN F=A XOR B’ 1 0 0 1 F= A+B+CIN F=A XOR B 1 0 1 1 F=(A OR B)+ CIN F=A+B 1 1 0 0 F= A+A+CIN F= 0000 1 1 1 1 F=A+CIN F=A
S S S
F F
M CIN A
S
F B
74x
F
COUT
A B A B A B
A=B
P
G
CEG/EE 260 - 55
Types of Sequential LogicTypes of Sequential Logic
z An Asynchronous Sequential Circuit uses ordinary gates and feedback loops to implement “memory” in a logic circuit.
z A Synchronous Sequential Circuit uses flip-flops (internally, an asynchronous sequential device) to form useful sequential logic functions or applications.
CEG/EE 260 - 56
Period
t (^) H
t (^) L
State change
Active
High
Period
t (^) H
t (^) L
State change
Active
Low
Duty Cycle = t (^) L/Period
Frequency = 1/Period
Clock Characteristics Clock Characteristics
Duty Cycle = t (^) H/Period
CEG/EE 260 - 57
Sequential Logic Definitions
z Clock - the master timing element behind the state changes of most sequential circuits.
CEG/EE 260 - 58
PositivePositive--EdgeEdge--Triggered D FlipTriggered D Flip--FlopFlop
Last Q
Last Q
Last /Q
Last /Q
Master Slave QM
Device samples inputs and changes state only on a clock edge. Simplifies the meeting of setup/hold times. Master FF - transparent on CLK’ (entire pulse) Slave FF - transparent on CLK (master fixed)
CEG/EE 260 - 59
MSI Quad/Hex RegistersMSI Quad/Hex Registers^ CLK CLR
4Q
4Q
3Q
3Q
2Q
2Q
1Q
1Q
1D
2D
3D
4D
CLK CLR
6Q
5Q
4Q
3Q
2Q
1Q
1D 2D 3D 4D 5D 6D
D
1Q
CLR
Q Q (^) /1Q
1D
D 2Q CLR
Q Q (^) /2Q
2D
D 3Q CLR
Q Q (^) /3Q
3D
D 4Q CLR
Q Q /4Q
4D
CLK
/CLR
All four flip-flops use the same clock! CEG/EE 260 - 60
Octal Register with Parallel Load Enable Octal Register with Parallel Load Enable
CLK Load
1D 2D 3D 4D 5D 6D 7D 8D
1Q 2Q 3Q 4Q 5Q 6Q 7Q 8Q
1D
/Load
CLK
1Q
Why don’t we gate the clock?
1b-mux
CEG/EE 260 - 61
Clocked Synchronous StateClocked Synchronous State--machine Modelmachine Model
Next-state Logic
F
State Memory
clock
Output Logic
G
inputs excitation
clock
current state outputs
(Mealy machine)
Moore Machine
State memory: Usually edge-triggered D or JK flip-flops
CEG/EE 260 - 62
Timing DiagramTiming Diagram
flip-flop outputs
t (^) H t (^) L t (^) clk
t (^) ffpd combinational logic
excitation inputs
t (^) comb
setup-time margin t (^) setup t (^) hold
CEG/EE 260 - 63
Programmable Logic DefinitionsProgrammable Logic Definitions
z Digital integrated circuit (MSI, LSI, VLSI)
z Many types of programmable logic
output
input
Combinational PLD
CEG/EE 260 - 64
Programmable Logic DefinitionsProgrammable Logic Definitions
z PLA
z PAL
Programmable LogicProgrammable Logic ReadRead--Only Memory (ROM)Only Memory (ROM)
z A combinational circuit with n inputs and b outputs:
2 n^ x b ROM
Address inputs A(n-1, ... , 0)
n b Data outputs D(b-1, ... , 0)
z Programmable ⎯ values determined by user z Nonvolatile ⎯ contents retained without power z Uniform (Random) Access ⎯ delay is uniform for all addresses
CEG/EE 260 - 73
Types of ROMs (2)Types of ROMs (2)
z EPROM
z EEPROM (E 2 ROM)
Word Line
Bit Line
CEG/EE 260 - 74
Types of ROMs (3)Types of ROMs (3)
z Flash Memory
CEG/EE 260 - 75
ROM Type SummaryROM Type Summary
Type
Mask ROM
Mask ROM
PROM
EPROM
EEPROM
FLASH
Technology NMOS, CMOS Bipolar Bipolar NMOS, CMOS NMOS CMOS
Read Cycle 20-200 ns <100 ns <100 ns 25-200 ns 50-200 ns 25-200 ns
Write Cycle 4 weeks 4 weeks 5 minutes 5 minutes 10 μs/byte 10 μs/block
Comments Write once; low power Write once; high power; low density Write once; high power; no mask charge Reusable; low power; no mask charge 10,000 writes/location limit 100,000 erase cycles
CEG/EE 260 - 76
Read/Write Memory (RWM / RAM)Read/Write Memory (RWM / RAM)
z RWM = RAM (Random Access Memory) z Highly structured like ROM’s and PLD’s z Can store and retrieve data at (relatively) the same speed
z Static RAM (SRAM) retains data in latches (while powered) z Dynamic RAM (DRAM) stores data as capacitor charge; all capacitors must be recharged periodically.
z Volatile Memory: Both Static and Dynamic RAM z Nonvolatile Memory: Data retained when power lost = ROMs, NVRAM (w/battery), Flash Memory
Basic Structure of SRAMBasic Structure of SRAM
z Address/Control/Data Out lines like a ROM (Reading)
2 n^ x b RAM A (^0) A (^1)
A (^) n-
DIN 0 DIN 1
WE
OE
CS
DINb-1 DOUTb-
DOUT 1
DOUT 0
One Bit of SRAMOne Bit of SRAM
z SEL and WR asserted → IN data stored in D-latch (Write) z SEL only asserted → D-latch output enabled (Read) z SEL not asserted → No operation
D Q
/WR
/SEL
IN OUT (^) IN SEL WR
OUT
C
CEG/EE 260 - 79
Structure of 8x4 SRAMStructure of 8x4 SRAM
z 3-to-8 Decoder selects one row of cells for Read or Write
z If ADDR + CS + OE are asserted, DOUT (3-0) is enabled. (Read)
z If ADDR + DIN + CS + WE are asserted, DIN → latches (Write)
CEG/EE 260 - 80
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SELWR
OUT
IN SEL WR
OUT
INSEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SELWR
OUT
IN SEL WR
OUT
INSEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SELWR
OUT
IN SEL WR
OUT
INSEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
IN SELWR
OUT
IN SEL WR
OUT
SELIN WR
OUT
IN SEL WR
OUT
IN SEL WR
OUT
3-to- Decoder
/WE /CS
/OE (^) DOUT3 DOUT2 DOUT1 DOUT
0 1 2 3 4 5 6 7
2 1 0
A A A
DIN3 DIN2 DIN1 DIN
CEG/EE 260 - 81
64K x 1 DRAM64K x 1 DRAM word line
bit line
1-bit DRAM cell
Row decoder
256 x 256 array
Row register, Data mux/demux
ADDR
Dout
Control /
8
/RAS /CAS /WE
Din
Col ADDR
Row ADDR
Control
ADDR Din
Dout
RAS CAS WE
8
64K x 1 DRAM
CEG/EE 260 - 82
Building a computerBuilding a computer
z To get a task done by a computer, we need two things:
z Low-level design of computer components is “digital design”
z The basic computer model for “programming” was proposed by John von Neumann in 1946
The von Neumann Model - The von Neumann Model- IllustrationIllustration
Memory: holds both data and instructions Processing Unit: carries out the instructions Control Unit: sequences and interprets instructions Input: external information into the memory Output: produces results for the user
Memory
Processing Unit Input (^) Output
Control Unit PC IR
(keyboard) (^) (monitor)
RAM Memory: A difference in scale RAM Memory: A difference in scale
z Memory is a large number of addressable fixed-sized locations
z Address Space
n bits allow the addressing of 2 n^ memory locations.
ADD_IN DATA_IN DATA_OUT
CEG/EE 260 - 91
Instruction CycleInstruction Cycle -- steps 1 & 2steps 1 & 2
z Fetch
z Decode
CEG/EE 260 - 92
Instruction CycleInstruction Cycle -- steps 3 & 4steps 3 & 4
z Evaluate Address
CEG/EE 260 - 93
Instruction CycleInstruction Cycle -- steps 5 & 6steps 5 & 6
z Execute
z Store Result
CEG/EE 260 - 94
Types of InstructionTypes of Instruction
z Operate Instructions
CEG/EE 260 - 95
Stopping the computerStopping the computer