CS61C - Lecture 13 - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

CS61C - Lecture 13

Description:

Title: CS61C - Lecture 13 Author: John Wawrzynek Last modified by: MS User Created Date: 8/19/1997 4:58:46 PM Document presentation format: Letter (8.5x11 ) – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 25
Provided by: JohnW417
Category:
Tags: cs61c | lecture

less

Transcript and Presenter's Notes

Title: CS61C - Lecture 13


1
Machine Structures Lecture 14 State Elements
Circuits that Remember
One Laptop per Child ?The OLPC project has
beenmaking news recently with its 100 Linux
laptop intended for every child on earth. Libya
just purchased 1.2 million of them (powered by a
wind-up crank). Cool!
laptop.org
2
Review
  • ISA is very important abstraction layer
  • Contract between HW and SW
  • Clocks control pulse of our circuits
  • Voltages are analog, quantized to 0/1
  • Circuit delays are fact of life
  • Two types of circuits
  • Stateless Combinational Logic (,,)
  • State circuits (e.g., registers)

3
Truth Tables for Representing CL Blocks
  • ??????????????????
  • ???????????????
  • ??????????????,????,?????????

4
???(Truth Table)?? 2-????
5
Circuits with STATE (e.g., register)
  • ???????
  • ?LOAD??????,????????,?????
  • ??????????????(??????)
  • ???load???,Input????????(???????,???????????????
    ????)
  • ????????(??????),?????????????

6
Register DetailsWhats inside?
  • N????( Flip-Flop )
  • Flip-flop name because the output flips and flops
    between and 0,1
  • D is data, Q is output
  • Also called d-type Flip-Flop

7
Whats the timing of a Flip-flop? (1/2)
  • Edge-triggered d-type flip-flop
  • This one is positive edge-triggered
  • ??????,????d??,??????. ????????
  • Example waveforms

8
Whats the timing of a Flip-flop? (2/2)
  • Edge-triggered d-type flip-flop
  • This one is positive edge-triggered
  • ??????,????d??,??????. ????????
  • Example waveforms (more detail)

9
???????
  • ???????
  • ????? (?MIPS??1-31)
  • ?? (?????)
  • ???????????????.
  • ??????????????????,????????.

10
???(Accumulator) Example
????????????
Want S0 for (i0iltni) S S
Xi
  • ??(Assume)
  • ??X???????,?????.
  • n????,S????????.

11
First tryDoes this work?
Feedback
????(Nope)! ??1 ???? for???????? ??2
????????? S0?
12
Second tryHow about this?
Roughtiming
????????????????.
13
Accumulator Revisited (proper timing 1/2)
  • Reset??????????? (???D???).
  • Si-1????ith-1?????.
  • ??????????????.

14
Accumulator Revisited (proper timing 2/2)
  • ???reset??.
  • ???,X????? Si-1???????
  • Si ???????, ????????????.
  • ????????, ???????????????

15
Pipelining to improve performance (1/2)
?????????????.
??
?? ????????1???????? ??????? adder/shifter????.
16
Pipelining to improve performance (2/2)
  • ??????????????.
  • ??????.

Timing
17
?????Finite State Machines (FSM)??
  • You have seen FSMs in other classes.
  • Same basic idea.
  • The function can be represented with a state
    transition diagram.
  • With combinational logic and registers, any FSM
    can be implemented in hardware.

18
Finite State Machine Example 3 ones
FSM to detect the occurrence of 3 consecutive 1s
in the input.
Draw the FSM
Assume state transitions are controlled by the
clock on each clock cycle the machine checks the
inputs and moves to a new state and produces a
new output
19
Hardware Implementation of FSM
Therefore a register is needed to hold the a
representation of which state the machine is in.
Use a unique bit pattern for each state.

?

Combinational logic circuit is used to implement
a function maps from present state and input to
next state and output.
20
Hardware for FSM Combinational Logic
Next lecture we will discuss the detailed
implementation, but for now can look at its
functional specification, truth table form.
Truth table
PS Input NS Output
00 0 00 0
00 1 01 0
01 0 00 0
01 1 10 0
10 0 00 0
10 1 00 1
21
General Model for Synchronous Systems
  • Collection of CL blocks separated by registers.
  • Registers may be back-to-back and CL blocks may
    be back-to-back.
  • Feedback is optional.
  • Clock signal(s) connects only to clock input of
    registers.

22
Peer Instruction
ABC 1 FFF 2 FFT 3 FTF 4 FTT 5 TFF 6
TFT 7 TTF 8 TTT
  1. HW feedback akin to SW recursion
  2. We can implement a D-Q flipflop as simple CL
    (And, Or, Not gates)
  3. You can build a FSM to signal when an equal
    number of 0s and 1s has appeared in the input.

23
Peer Instruction Answer
  • It needs base case (reg reset), way to step
    from i to i1 (use register clock).
  • True!
  • D-Q has state, CL never has state!
  • False!
  • How many states would it have? Say its n. How
    does it know when n1 bits have been seen?
  • False!

ABC 1 FFF 2 FFT 3 FTF 4 FTT 5 TFF 6
TFT 7 TTF 8 TTT
  1. HW feedback akin to SW recursion
  2. We can implement a D-Q flipflop as simple CL
    (And, Or, Not gates)
  3. You can build a FSM to signal when an equal
    number of 0s and 1s has appeared in the input.

24
And In conclusion
  • Verilog is used to describe and simulate hardware
  • Simple subset used in this class
  • State elements are used to
  • Build memories
  • Control the flow of information between other
    state elements and combinational logic
  • D-flip-flops used to build registers
  • Clocks tell us when D-flip-flops change
  • Setup and Hold times important
  • We pipeline long-delay CL for faster clock
  • Finite State Machines extremely useful
Write a Comment
User Comments (0)
About PowerShow.com