34
Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables. Note: About making past midterms and finals available. Seqeuential Logic State Machines Memory

Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

  • Upload
    kamran

  • View
    24

  • Download
    0

Embed Size (px)

DESCRIPTION

Seqeuential Logic State Machines Memory. Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables. Note: About making past midterms and finals available. 4. 1. 8. 4. 30. 25. 5. 20. 10. 15. Combinational vs. Sequential Logic. - PowerPoint PPT Presentation

Citation preview

Page 1: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables.

Note: About making past midterms and finals available.

• Seqeuential Logic • State Machines • Memory

Page 2: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Combinational vs. Sequential Logic

• There are two types of “combination” locks

4 1 8 4

30

15

5

1020

25

Combinational:Success depends only onthe values, not the order in which they are set.

Sequential:Success depends onthe sequence of values(e.g, R-13, L-22, R-3).

Page 3: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

State Machine• A type of sequential circuit

– Combines combinational logic with storage– “Remembers” state, and changes output (and state)

based on inputs and current state

State Machine

CombinationalLogic Circuit

StorageElements

Inputs Outputs

• A Mealy machine has outputs that depend on the state and input • A Moore machine has outputs that depend on state only

Page 4: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Finite State Machine• A description of a system with the following

components:

1. A finite number of states2. A finite number of external inputs3. A finite number of external outputs4. An explicit specification of all state transitions5. An explicit specification of what determines each external

output value

• Often described by a state diagram. - The set of all possible states.

- Inputs that trigger state transitions.- Outputs associated with each state (or with each

transition).

Page 5: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

State Diagram

• Shows states (e.g. A) and actions (e.g. R-13) that cause a transition between states.

Page 6: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

State

• The state of a system is a snapshot of all the relevant elements of the system at the moment the snapshot is taken.

•Examples:– The state of a basketball game can be represented by

the scoreboard.(Number of points, time remaining, possession, etc.)

– The state of a tic-tac-toe game can be represented bythe placement of X’s and O’s on the board.

Page 7: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

State of Sequential Lock

Our lock example has four different states, labelled A-D:

A: The lock is not open,and no relevant operations have been performed.

B: The lock is not open,and the user has completed the R-13 operation.

C: The lock is not open,and the user has completed R-13, followed by L-22.

D: The lock is open.

Page 8: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

State Diagram

• Shows states (e.g. A) and actions (e.g. R-13) that cause a transition between states.

Page 9: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

The Clock• Frequently, a clock circuit triggers transition fromone state to the next.

• At the beginning of each clock cycle, the state machine makes a transition, based on the current state and the external inputs (Synchronous).

– Not always required. In lock example, the input itself triggers a transition (Asynchronous).

“1”“0”

timeOneCycle

Page 10: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Implementing a Finite State Machine

• Combinational logic– Determine outputs at each state. – Determine next state.

• Storage elements– Maintain state representation.

State Machine

CombinationalLogic Circuit

StorageElements

Inputs Outputs

Clock

Page 11: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Storage• Each master-slave flipflop stores one state bit.

• The number of storage elements (flipflops) neededis determined by the number of states(and the representation of each state).

• Examples:– Sequential lock

•Four states – two bits– Basketball scoreboard

•7 bits for each score digit, 5 bits for minutes, 6 bits for seconds,1 bit for possession arrow, 1 bit for half, …

Page 12: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

22 x 3 Memory

addressdecoder

word select word WEaddress

writeenable

input bits

output bits

Page 13: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

1K X 4 SRAM (Part Number 2114N)

Page 14: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Memory Design – 1K x 4

A[09:00] D[03:00]

Addr Block Select

Page 15: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Memory Design – 1K x 8

A[09:00] D[07:04]

A[09:00] D[03:00]

Addr Block Select =>

Addr Block Select =>

D[07:04] D[03:00]

Page 16: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Memory Design - 2k x 8D[07:04] D[03:00]

Block 01

Block 00

Page 17: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Memory Design - 4k x 8 D[07:04] D[03:00]

Block 11

Block 10

Block 01

Block 00

Page 18: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

More Memory Details

Two basic kinds of RAM (Random Access Memory)

• Static RAM (SRAM)– fast, maintains data as long as power applied

• Dynamic RAM (DRAM)– slower but denser, bit storage decays – must be

periodically refreshed. Refreshing interferes with regularity of execution of instruction stream.

Also, non-volatile memories: ROM, PROM, flash, …

Page 19: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

256k DRAM (256K x 1)

Page 20: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

16 M DRAM (4M x 4)

Page 21: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

1MByte DRAM (1Meg x 8 bits)

Page 22: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Some Major Advances in Computers in 50 years

• VLSI• The family concept• Microprogrammed control unit• Cache memory• MiniComputers• Microprocessors• Pipelining• PC’s• Multiple processors• RISC processors• Hand helds

Page 23: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

• CISC – Complex Instruction Set Computer

• RISC – Reduced Instruction Set Computer

• Superscalar – Multiple similar processing units are used to execute instructions in parallel

Three Classes of Today’s Computer Architectures

Page 24: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Comparison of Processors

Page 25: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Driving force for CISC• Software costs far exceed hardware costs• Increasingly complex high level languages• A “Semantic” gap between HHL & ML

• This Leads to:– Large instruction sets– More addressing modes– Hardware implementations of HLL statements

• e.g. CASE (switch) on VAX (long, complex structure)

Page 26: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Intention of CISC

• Ease compiler writing

• Improve execution efficiency

• Support more complex HLLs

Page 27: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

RISC• Reduced Instruction Set Computer

• Key features:– Large number of general purpose registers (or use of compiler technology to optimize register

use)

– Limited and simple instruction set

– Emphasis on optimising the instruction pipeline & memory management

Page 28: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Breadth of RISC Characteristics

Page 29: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

The debate: Why CISC ?• Compiler simplification?

– Dispute… - Complex machine instructions are harder to

exploit - Optimization actually may be more difficult

• Smaller programs? (Memory is now cheap)– Programs may take up less instructions, but…– May not occupy less memory, just look shorter in symbolic form

• More instructions require longer op-codes, more memory references

• Register references require fewer bits

Page 30: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

The Debate: Why CISC ? • Faster programs ?

– More complex control unit– Microprogram control store larger– Thus instructions may take longer to

execute • Instructions are not of consistent

length and take different lengths of time to complete.

• Legacy challenges

Page 31: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Controversy Continued: CISC vs RISC

Challenges of comparison– There are no pair of RISC and CISC that are

directly comparable– There are no definitive set of test

programs– It is difficult to separate hardware effects

from complier effects– Most comparisons are done on “toy” rather

than production machines– Most commercial machines are a mixture

Page 32: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Concentrating on RISC:Major Characteristics:• One instruction per cycle• Register to register operations• Few, simple addressing modes• Few, simple instruction formats

Also:• Hardwired design (no microcode)• Fixed instruction format

But:• More compile time/effort

Page 33: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Early RISC Computers

• MIPS – Microprocessor without Interlocked Pipeline Stages Stanford (John Hennessy) MIPS Technology

• SPARC – Scalable Processor Architecture Berkeley (David Patterson) Sun Microsystems

• 801 – IBM Research (George Radin)

Page 34: Note: I did clean up the slides from last period, particularly improving the FlipFlop transition tables

Characteristics of Some Example Processors