Docsity

Combinational System Analysis - Lecture Slides | EE 260, Study notes of Microelectronic Circuits

Toggle sidebar
bg1
CEG/EE 260
Digital Computer Hardware
Dr. Travis Doom, Associate Professor
Department of Computer Science and Engineering
Wright State University
Section I:
Section I:
Combinational System Analysis
Combinational System Analysis
CEG/EE 260 - 2
Acknowledgements
Acknowledgements
zThese slides were developed with the aid of examples found in:
– “Digital Design” – Frank Vahid
– “Logic and Computer Design Fundamentals” - M. Morris Mano
– “Digital Design: Principles and Practices” - John Wakerly
– “Introduction to Computing Systems” – Patt/Patel
zFigures many of the slides were kindly provided by:
– Dr. Roger L. Haggard
– Dr. Travis E. Doom
CEG/EE 260 - 3
What
What is
is a computer?
a computer?
zWhat is computation?
zThere are many sorts of computing devices, they fall into two categories:
– Analog: machines that produce an answe r that measures some continuous physical
property such as distance, light intensity, or voltage. Exa mples?
– Digital: machines that perform computations by manipulating a fixed finite set of
elements. Examples?
– The difficulty with analog devices is that it is very hard to increase their accuracy.
zBefore modern digital computers, the most common digital machines were
adding machines.
– Adding machines perform exactly one sort of operation.
zComputers also perform one operation… but their operation is to accept a set of
instructions that tell it how to do any sort of computation.
CEG/EE 260 - 4
Universal computing devices
Universal computing devices
zTuring’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).
zWhat does this imply?
– All computers (from the leas t expensive to the most expensive) are capable of
computing EXACTLY the same things IF they are given enough time and enough
memory.
– Some computers can do things faster, but none can do more than any other co mputer.
–All computers can do exactly the same same things!
zThus, any given problem is either computable or it is not computable
–Problems may be computable, but still not feasible (NPC)
CEG/EE 260 - 5
How
How do
do we get the electrons to do the work?
we get the electrons to do the work?
zWe describe our problems in English or some other natural language. Computer
problems are solved by electrons flowing around inside the computer.
zIt is necessary to transform our problem from a natural language to the voltages
that influence the flow of electrons.
zThis 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.
CEG/EE 260 - 6
The principle of design abstraction
The principle of design abstraction
zGeneral 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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Combinational System Analysis - Lecture Slides | EE 260 and more Study notes Microelectronic Circuits in PDF only on Docsity!

CEG/EE 260

Digital Computer Hardware

Dr. Travis Doom, Associate Professor

Department of Computer Science and Engineering

Wright State University

Section I:Section I:

Combinational System AnalysisCombinational System Analysis

CEG/EE 260 - 2

AcknowledgementsAcknowledgements

z These slides were developed with the aid of examples found in:

  • “Digital Design” – Frank Vahid
  • “Logic and Computer Design Fundamentals” - M. Morris Mano
  • “Digital Design: Principles and Practices” - John Wakerly
  • “Introduction to Computing Systems” – Patt/Patel

z Figures many of the slides were kindly provided by:

  • Dr. Roger L. Haggard
  • Dr. Travis E. Doom

CEG/EE 260 - 3

WhatWhat^ isis^ a computer?a computer?

z What is computation? z There are many sorts of computing devices, they fall into two categories:

  • Analog: machines that produce an answer that measures some continuous physical property such as distance, light intensity, or voltage. Examples?
  • Digital: machines that perform computations by manipulating a fixed finite set of elements. Examples?
  • The difficulty with analog devices is that it is very hard to increase their accuracy. z Before modern digital computers, the most common digital machines were adding machines.
  • Adding machines perform exactly one sort of operation. z Computers also perform one operation… but their operation is to accept a set of instructions that tell it how to do any sort of computation.

CEG/EE 260 - 4

Universal computing devicesUniversal computing devices

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?

  • All computers (from the least expensive to the most expensive) are capable of computing EXACTLY the same things IF they are given enough time and enough memory.
  • Some computers can do things faster, but none can do more than any other computer.
  • All computers can do exactly the same same things!

z Thus, any given problem is either computable or it is not computable

  • Problems may be computable, but still not feasible (NPC)

HowHow^ dodo^ we get the electrons to do the work?we get the electrons to do the work?

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.

The principle of design abstractionThe principle of design abstraction

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.”

  • How fast time passes
  • Track meet
  • Gossip z A computer is an electronic idiot and can not deal with any ambiguity, thus…

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:

  • That transforms an input (possibly NULL) into some output (or output action)
  • That is guaranteed to terminate z Definiteness : Each step is precisely stated. z Effective computability : Each step must be something the computer can perform z Finiteness : The procedure must terminate z For any computable problem, there are an infinite number of algorithms to solve it.
  • Which solution is best?

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:

  • High-level languages are machine independent. They are “far above” the (underlying) computer
  • Low-level languages are machine dependent. They are tied to the computer on which the program will execute. There is generally only one such language per machine (referred to as its ASSEMBLY language).

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.

  • Examples: IA-32 (Intel, AMD, and others), PowerPC (Motorola) z Programs are translated from high languages in to the ISA of the computer on which they will be run by a program called a compiler (specific to the ISA). z Programs are translated from assembly to the ISA by an assembler z Analogy: A car
  • The car’s ISA describes what the driver sees/uses.

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.

  • The IA-32 has been implemented by several different processors over the past twenty years 8086 (Intel, 1979), 8286, 8386, 8486, Pentium, PentiumII, Athlon, PentiumIII.
  • Each implementation is an opportunity for computer designers to make different trade-offs between cost and performance. [Computer design is always an exercise in trade-offs.] z Analogy: A car
  • The implementation of a car’s ISA is what goes on under the hood. Here all automobiles makes and models are different. Some with fuel injection, some have eight cylinders, some are turbocharged… in each case the “microarchitecture” of a specific automobile is the result of the automobile designers’ decisions regarding cost and performance.

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

  • 10s of transistors per unit z MSI: Medium Scale – 100s of transistors z LSI: Large Scale – 1000s of transistors z VLSI: Very Large Scale – 100,000s+ transitors

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:

  • Bubble-to-Bubble logic
  • All wires are either horizontal or vertical
  • All wires are labeled with expression z Prepend with / if active low
  • Wires are connected at “T” intersections
  • Wires are not connected at “X” intersections z Schematic diagrams should include
  • IC-Type-Logic Family
  • Pin numbers- Pin Diagram
  • Reference designator- Unit Number

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

  • Continuous signal levels
  • Very small, smooth level changes

z Digital characteristics

  • Discrete signal levels (voltage usually)
  • Two levels: on/off, high/low, True/False, 1/
  • Disjoint or quantized level changes

z Digital Concepts and Devices

  • Digital Design also called Logic Design
  • Logic Gates - the most basic digital devices
  • Digital devices have analog electronic aspects z Exercise: list some of these aspects

t

v

v

t

Electronic Aspects of Digital DesignElectronic Aspects of Digital Design

z Vin low → Ib = 0

  • transistor cut off: V (^) out = V (^) cc z Vin high → Ib > 0
  • transistor “on”: V (^) out = GND

V (^) in

V (^) out

GND

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

Electronic Aspects of Digital DesignElectronic Aspects of Digital Design

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

  • in low state = V (^) ILmax - V (^) OLmax = 1.5 V - 0.1 V= 1.4 V for 5V CMOS
  • in high state = V (^) OHmin - V (^) IHLmin = 4.9 V - 3.5 V= 1.4 V for 5V CMOS

Voltage Outputs

Noise Margin Inputs

Logic 0 Logic 0

Logic 1 (^) Logic 1

Invalid

CEG/EE 260 - 26

Electronic Aspects of Digital DesignElectronic Aspects of Digital Design

z Logic gates Specifications :

  • Conditions under which the digital device produces and recognizes logic signals within the appropriate range.

z - Examples :

  • Power-supply voltage
  • Temperature
  • Loading
  • Frequency

z Manufacturer specifications ( data sheets )

CEG/EE 260 - 27

Propagation DelayPropagation Delay

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

Timing Diagrams Timing Diagrams

Y

X

X

Y

t (^) pLH(XY) t (^) pHL(XY) t (^) rise t (^) fall

Actual Timing Diagram

Functional Timing Diagram

X

Y

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

  • Illustrates operation, but does not specify upper and lower limits
  • Not always sufficient for a real design

CEG/EE 260

Digital Computer Hardware

Dr. Travis Doom, Associate Professor

Department of Computer Science and Engineering

Wright State University

Section III:Section III:

Complex Combinational SystemsComplex Combinational Systems

CEG/EE 260 - 30

DecoderDecoder

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 :

  • Each input code produces only one output code. z Input codes :
  • Binary Code
  • Gray Code
  • BCD Code
  • Your Code!

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.

  • O 0 = F 0 (x 0 …x (^) n)
  • O 1 = F 1 (x 0 …x (^) n)
  • …
  • Om = F (^) m(x 0 …xn)

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

  • Natural representation for human transactions z Floating point number cannot exactly represent $1.
  • Even carries through in scientific notation z 1.5213 X 10 4 z Hard to Implement Electronically
  • Hard to store z ENIAC (First electronic computer) used 10 vacuum tubes / digit
  • Hard to transmit z Need high precision to encode 10 signal levels on single wire
  • Messy to implement digital logic functions z Addition, multiplication, etc. z Base 2 Number Representation
  • Easy to store with bistable elements
  • Reliably transmitted on noisy and inaccurate wires z Examples
  • Represent 15213 10 as 11101101101101 2
  • Represent 1.20 10 as 1.0011001100110011[0011]… (^2)
  • Represent 1.5213 X 10^4 as 1.1101101101101 2 X 2 13

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

N = number of bits

Range is: 0 ≤ i < 2N^ – 1

Umin = 0

Umax = 2 N^ – 1

(where the digits a, b, c can each take on the values of 0 or 1 only)

Problem:

  • How do we represent

negative numbers?

Signed MagnitudeSigned Magnitude

z Leading bit is the sign bit

Range is: -2 N-1^ + 1 < i < 2 N-1^ – 1

Smin = -2 N-1^ + 1

Smax = 2 N-1^ – 1

Y = “abc” = (-1) a^ (b.2^1 + c.2^0 )

Problems:

  • How do we do addition/subtraction?
  • We have two numbers for zero (+/-)!

Two’ Two’s Complements Complement

z Transformation

  • To transform a into -a, invert all bits in a and add 1 to the result

Range is: -2 N-1^ < i < 2 N-1^ – 1

Tmin = -2 N-

Tmax = 2 N-1^ – 1

Advantages:

  • Operations need not check the sign
  • Only one representation for zero
  • Efficient use of all the bits

CEG/EE 260 - 43

Manipulating Binary numbers - Manipulating Binary numbers- 1 1

z Binary to Decimal conversion & vice-versa

  • A 4 bit binary number A = a 3 a 2 a 1 a 0 corresponds to: a 3 x 2^3 + a 2 x 2^2 + a 1 x 2^1 + a 0 x 2^0 = a 3 x 8 + a 2 x 4 + a 1 x 2 + a 0 x 1 (where ai = 0 or 1 only)
  • A decimal number can be broken down by iteratively determining the highest power of two that “fits” in the number: e.g. (13) 10 => e.g. (63) 10 => e.g. (0.63) 10 =>
  • In the 2’s complement representation, leading zeros do not affect the value of a positive binary number, and leading ones do not affect the value of a negative number. So: 01101 = 00001101 = 13 and 11011 = 11111011 = -

00001101 11111011 00001000 => 8 (as expected!)

CEG/EE 260 - 44

Manipulating Binary numbersManipulating Binary numbers -- 2 2

z Overflow

  • If we add the two (2’s complement) 4 bit numbers representing 7 and 5 we get : 0111 => + 0101 => + 1100 => -4 (in 4 bit 2’s comp.) z We get -4, not +12 as we would expect !! z We have overflowed the range of 4 bit 2’s comp. (-8 to +7), so the result is invalid. z Note that if we add 16 to this result we get back 16 - 4 = 12
  • this is like “stepping up” to 5 bit 2’s complement representation
  • In general, if the sum of two positive numbers produces a negative result, or vice versa, an overflow has occurred, and the result is invalid in that representation.

CEG/EE 260 - 45

CS RealityCS Reality

z You’ve got to understand binary encodings.

z Examples

  • Is x 2 ≥ 0?
  • Is (x + y) + z = x + (y + z)?

CEG/EE 260 - 46

C Integer PuzzlesC Integer Puzzles

  • Assume machine with 32 bit word size, two’s complement integers
  • For each of the following C expressions, either: z Argue that is true for all argument values z Give example where not true - Is (xx >= 0) always true?* - Is (ux >= 0) always true? - If x<0, Is (2x) < 0 true?*

int x = foo();^ •^ Is ( x+(y+z) == (x+y)+z)^ )? int y = bar(); unsigned ux = x; unsigned uy = y;

Initialization

CEG/EE 260 - 47

MSI Arithmetic Logic Units (ALU ) MSI Arithmetic Logic Units (ALU )

z ALU performs Arithmetic and Logical Functions

  • A , B : 4 bits inputs
  • S3,S2,S1,S0 : Function select
  • M=0 : Arithmetic operations +=Plus , - = Minus M=1 : Logical operations : += OR ,. =AND

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

Digital Computer Hardware

Dr. Travis Doom, Associate Professor

Department of Computer Science and Engineering

Wright State University

Section IV:Section IV:

Computer HardwareComputer Hardware

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.

  • Meeting minimum pulse width requirements may be tricky

z A Synchronous Sequential Circuit uses flip-flops (internally, an asynchronous sequential device) to form useful sequential logic functions or applications.

  • The state variables and outputs of a synchronous system change with respect to a controlling clock signal
  • Meeting minimum pulse width requirements is simplified by restating all timing constraints in terms of the clock signal

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.

  • a clock signal is active high if the state changes occur at the rising edge (for edge triggered devices) or in the logic 1 state (for pulse-triggered devices)
  • active low if state changes occur at the falling edge or in the logic 0 state. z Clock Period - time between successive transitions in the same direction z Clock Frequency - reciprocal of the clock period z Clock Tick - the first edge or pulse in a clock period, or the period itself z Duty Cycle - the percentage of time that a clock is at its assertion level

CEG/EE 260 - 58

PositivePositive--EdgeEdge--Triggered D FlipTriggered D Flip--FlopFlop

D

>CLK

Q

Q

D

C

Q D

C

Q

Q

D

CLK

Q

/Q

D CLK Q /Q

X

X

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

74LS

1D

2D

3D

4D

CLK CLR

6Q

5Q

4Q

3Q

2Q

1Q

74LS

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

74LS

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

D Q

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

CLOCK

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)

  • manufactured as a standard off-the-shelf component
  • containing “regular” array of logic gates and flip-flops
  • whose logic functions are determined by the application design engineer and implemented locally

z Many types of programmable logic

  • sometimes generically called PLDs (Programmable Logic Devices)
  • PAL or PLD
  • PROM
  • FPGA

output

input

Combinational PLD

CEG/EE 260 - 64

Programmable Logic DefinitionsProgrammable Logic Definitions

z PLA

  • Programmable Logic Array
  • first PLDs
  • simple programmable AND/OR array
  • programmed by “blowing fuses” by hand or by mask

z PAL

  • Programmable Array Logic
  • similar to a PLA, but the OR- array is fixed
  • most commonly used PLD
  • may include input/output flip- flops z GAL
  • Generic Array Logic
  • can be configured to emulate the AND/OR, flip-flop, and output structure of a variety of combinational and sequential PAL devices z FPGA
  • Field Programmable Gate Array

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

  • Erasable Programmable ROM
  • Charge trapped on extra “floating gate” of MOS transistors
  • Exposure to UV light removes charge z 10-20 minutes z Quartz Lid = expensive package
  • Limited number of erasures (10-100)

z EEPROM (E 2 ROM)

  • Electrically Erasable ROM
  • Floating gates charged/discharged electrically
  • Not RAM! (relatively slow charge/discharge)
  • limited number of charge/discharge cycles (10,000)

Word Line

Bit Line

CEG/EE 260 - 74

Types of ROMs (3)Types of ROMs (3)

z Flash Memory

  • Electronically erasable in blocks
  • 100,000 erase cycles
  • Simpler and denser than EEPROM
  • Often used for firmware

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)

  • Write Enable (WE) and Data In (DIN) (Writing)

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

8 x 4

SRAM

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:

  • a computer program that specifies what must be done to complete the task
  • hardware that is capable of completing those tasks as specified

z Low-level design of computer components is “digital design”

  • CEG 360 will cover much of this in detail.

z The basic computer model for “programming” was proposed by John von Neumann in 1946

  • CEG 320 will cover much of this is detail

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

MAR MDR

ALU TEMP

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

  • Each location has an address and contents z Address: bit pattern that uniquely identifies a memory location z Contents/Data: bit pattern stored at a given address. z analogy: p.o. boxes have fixed numbers, but changing contents.
  • A large number of locations
  • Each uniquely identifiable (its address)
  • Each having the ability to store a value of a certain size (its addressability)

z Address Space

n bits allow the addressing of 2 n^ memory locations.

  • Example: 24 bits can address 2 24 = 16,777,216 locations (i.e. 16M locations)… but what SIZE is each location?

ADD_IN DATA_IN DATA_OUT

CEG/EE 260 - 91

Instruction CycleInstruction Cycle -- steps 1 & 2steps 1 & 2

z Fetch

  • The first step is to read an instruction from memory.
  • This actually takes several smaller steps, or “micro-instructions”: z MAR ← (PC) ; use the value in PC to access memory z PC ← (PC) + 1 ; increment the value of PC z MDR ← Mem[MAR] ; read memory location to MDR z IR ← (MDR) ; copy (MDR) to IRDecode
  • Steps 1, 2 & 4 take a single machine cycle each, but step 3 (memory access) can take many machine cycles.

z Decode

  • The opcode is input to a decoder, which sets up the ensuing sequence of events according the instruction.

CEG/EE 260 - 92

Instruction CycleInstruction Cycle -- steps 3 & 4steps 3 & 4

z Evaluate Address

  • Computes the address of the operand (if any), or of the memory location to be accessed: e.g. the location from which to obtain a value in a LOAD instruction. z This is known as the Effective Address (EA). z Register to Register instructions don’t have an evaluate address phase. z Fetch Operands
  • Obtains the source operand(s), if required for execution.
  • Operands can come from Registers or RAM, or be embedded in the instruction itself. z The Effective Address (EA) determined in the previous step may be used to obtain an operand from memory.

CEG/EE 260 - 93

Instruction CycleInstruction Cycle -- steps 5 & 6steps 5 & 6

z Execute

  • Now that everything is in place, the instruction is executed. z e.g. if the opcode was ADD, the two source operands are added by the ALU. z If the opcode was a control instruction, a value is written to the PC z Data Movement instructions don’t have an execute phase

z Store Result

  • If there is a result from the operation it is written to memory (using the EA), or to a register. z Then REPEAT
  • The control unit just keeps repeating this whole process: Recall that the PC was incremented in the first step (FETCH), so the instruction retrieved will be the next in the program as stored in memory - unless the instruction just executed changed the contents of the PC.

CEG/EE 260 - 94

Types of InstructionTypes of Instruction

z Operate Instructions

  • process data (addition, logical operations, etc.) z Data Movement Instructions …
  • move data between memory locations and registers. z Control Instructions …
  • change the sequence of execution of instructions in the stored program. z The default is sequential execution: the PC is incremented by 1 at the start of every Fetch, in preparation for the next one. z Control instructions set the PC to a new value during the Execute phase, so the next instruction comes from a different place in the program. z This allows us to build control structures such as loops and branches.

CEG/EE 260 - 95

Stopping the computerStopping the computer

  • “User” programs terminate simply by handing control back to the Operating System (OS): z The OS then enters a “waiting” loop until a new program is run. z The Control Unit is still actively stepping through the instruction cycle.
  • Left to itself, the control unit would just keep fetching instructions from memory … until we pull the plug! z We can cease processing completely by stopping the machine cycle - i.e. by stopping the clock.