Computing With Switches and Circuits (1)

Embed Size (px)

Citation preview

  • 8/18/2019 Computing With Switches and Circuits (1)

    1/29

    Computing with Switches and Circuits

    Part 2

    1004QBT

    Foundations of ComputingSystems

  • 8/18/2019 Computing With Switches and Circuits (1)

    2/29

    Lecture !"ecti#e

    •  This wee$% we&'' continue to 'oo$ ate'ectrica' circuits that wou'd !e usedinside your computer

  • 8/18/2019 Computing With Switches and Circuits (1)

    3/29

    QUIZ TIME!

    (wahahaha

  • 8/18/2019 Computing With Switches and Circuits (1)

    4/29

    LAST WEEK 

    )e#ision

  • 8/18/2019 Computing With Switches and Circuits (1)

    5/29

    Last *ee$

    • Boo'ean 'ogic gates – +,-

     – )

     –,T

     – ,)

     – ,+,-

     – .)

    • /'ectromechanica'and 'ogica' circuits

    • Binarymathematics – -ecima' to !inary

     – Binary to decima'

     –

    Binary addition%su!traction%mu'tip'ication%di#ision

    (athematica'circuits – a'fadder

     – Fu''adder

     – (u'tip'eor

  • 8/18/2019 Computing With Switches and Circuits (1)

    6/29

    ow does a #on ,eumann machineuse Boo'ean and +rithmetic circuits3

  • 8/18/2019 Computing With Switches and Circuits (1)

    7/29

    STORAGE CIRCUITS

    Computer memory

  • 8/18/2019 Computing With Switches and Circuits (1)

    8/29

    Storage in a vonNeumann Macine

     The CP registers are made upof a series of fip-fops5

    *e&'' 'oo$ at how to !ui'd 6ip6ops and how they wor$5

    Before we get there% we needto 'oo$ at some of thecomponents5

  • 8/18/2019 Computing With Switches and Circuits (1)

    9/29

    Feed!ac$

    •  To store information% circuits musteedback into each other5

    • + set/reset (SR) latch does this usingtwo ,) gates

    ,or gates7 re'ay diagram of de (organ #ariant% and !oth #ersions of 'ogica'

  • 8/18/2019 Computing With Switches and Circuits (1)

    10/29

    S) Latches in peration

    +n S) 'atch with the reset 'inemo#ing from o8 to on

    +n S) 'atch with the reset 'inemo#ing from on to o8 

  • 8/18/2019 Computing With Switches and Circuits (1)

    11/29

    S) Latches in peration

    +n S) 'atch with the reset 'inemo#ing from o8 to on

    +n S) 'atch with the reset 'inemo#ing from on to o8 

  • 8/18/2019 Computing With Switches and Circuits (1)

    12/29

    S) Latches in peration

    +n S) 'atch with the set 'inemo#ing from o8 to on

    +n S) 'atch with the set 'inemo#ing from on to o8 

  • 8/18/2019 Computing With Switches and Circuits (1)

    13/29

    S) Latches in peration

    +n S) 'atch with the set 'inemo#ing from o8 to on

    +n S) 'atch with the set 'inemo#ing from on to o8 

  • 8/18/2019 Computing With Switches and Circuits (1)

    14/29

    Latches and Fetch/ecute

    • *e can now ma$e our computer remem!erone !it per S) Latch5

    • 9n a #on ,eumann machine% we want to !e

    a!'e to update a'' 'atches at the same time5• 9n the Fetch/ecute cyc'e% we used the

    c'oc$ to synchronise actions5 *e can do thesame thing here5

    • *e ca'' the new 'atch a datatype :-type;'atch

  • 8/18/2019 Computing With Switches and Circuits (1)

    15/29

    -type Latch,T

    switch

  • 8/18/2019 Computing With Switches and Circuits (1)

    16/29

    -type 'atch in Logisim

  • 8/18/2019 Computing With Switches and Circuits (1)

    17/29

    Te S"tem C#oc$ 

     The c'oc$ sends an osci''ating signa'5 The -type 'atchcan on'y update when the c'oc$ signa' is high5therwise% the +,- circuit wi'' not !e c'osed andcurrent can&t 6ow to the S/T or )/S/T inputs of the S)

    'atch5

  • 8/18/2019 Computing With Switches and Circuits (1)

    18/29

    -type Latch

    •  There is one specia'case where this -type'atch won&t wor$ as weepect5

    • )emem!er that in a#on ,eumannmachine% ca'cu'ationshad operands that

    speci

  • 8/18/2019 Computing With Switches and Circuits (1)

    19/29

    Te &'t(e )#i( )#o(

    + 6ip6op uses two 'atches% one to ho'd the current state%and the other to o#erwrite when the ,T instruction iscomp'eted5

  • 8/18/2019 Computing With Switches and Circuits (1)

    20/29

    Te &'t(e )#i( )#o(+ 6ip6op uses two 'atches% one to ho'd the current state%and the other to o#erwrite when the ,T instruction iscomp'eted5

  • 8/18/2019 Computing With Switches and Circuits (1)

    21/29

    CP )egisters

    • *e ha#e now seen how to !ui'd CPregisters5

    •  To store > !its% you wou'd use > -type 6ip6ops in para''e'5

  • 8/18/2019 Computing With Switches and Circuits (1)

    22/29

    *OOLEAN SELECTION

    ow to ma$e the 9nstructions wor$

  • 8/18/2019 Computing With Switches and Circuits (1)

    23/29

    Performing Computations

    • 9n a #on ,eumann machine% the instructionregister is connected to the other registersand the +L in such a way that entering

    the instruction causes a cascade thatupdates a'' re'e#ant registers e#ery c'oc$tic$5

    • -uring the etch of the fetcheecute cyc'e%

    an instruction is 'oaded into the instructionregister5

    • 9t then gets decoded5

  • 8/18/2019 Computing With Switches and Circuits (1)

    24/29

     The -ecoder

    • 9nstructions areentered as a !inarynum!er5

    perations are !ui'tinto your computer ascircuits5

    •  The decoder is a

    circuit which ta$esthe input num!er anduses it to acti#ate aparticu'ar output 'ine5

  • 8/18/2019 Computing With Switches and Circuits (1)

    25/29

    (u'tip'eing

    • nce the decoderhas se'ected anoutput% we can use

    a mu'tip'eor tose'ect one set ofdata5

    •  This data can come

    from a register% or!e the output of anoperation5

  • 8/18/2019 Computing With Switches and Circuits (1)

    26/29

    -emu'tip'eing

    • *e can a'so go theopposite way%using a

    demultiplexor todecide where tosend one !it ofdata5

  • 8/18/2019 Computing With Switches and Circuits (1)

    27/29

    *UIL&ING T+E C,U

    Putting the pieces together

  • 8/18/2019 Computing With Switches and Circuits (1)

    28/29

    +L

    • *e can put a'' ourarithmetic and 'ogiccircuits together tocreate an +L5

    • *e can ha#e mu'tip'e+Ls in para''e' to domu'tip'e !its ofca'cu'ation5

    • ,ote that a mu'tip'eoris used to se'ect oneoutput from the +L5

    (      u    

    '     t     i       p    '      e    2    

     o    r    

  • 8/18/2019 Computing With Switches and Circuits (1)

    29/29

    9nstruction )egister

    •  The opcode of the instructionregister is used to se'ect an outputfrom an operations a#ai'a!'e on the

    +L5

    •  The operands of the +L are used tose'ect an input from the CP

    registers% to !e fed into the +L5

    •  ?ou now ha#e e#erything you need to

    !ui'd a CP or a ca'cu'atorA