1 / 27

Hoe werkt een “loopje” nu precies?

Hoe werkt een “loopje” nu precies?. Recapitulatie rekenmachines week 1 Van rekenmachine naar rekenmachine met “loopjes”. Recapitulatie rekenmachines Vier hoofdcomponenten en hun samenhang. Rekenmachine II. Instructieset. Rekenkundige en logische instructies ADD SUB AND

zach
Download Presentation

Hoe werkt een “loopje” nu precies?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hoe werkt een “loopje” nu precies? • Recapitulatie rekenmachines week 1 • Van rekenmachine naar rekenmachine met “loopjes”

  2. Recapitulatie rekenmachines Vier hoofdcomponenten en hun samenhang

  3. Rekenmachine II

  4. Instructieset • Rekenkundige en logische instructies • ADD • SUB • AND • Immediate instructies (Instructies met één constant getal) • LOADI • ADDI • SUBI • ANDI • Datatransfer • COPY

  5. Instructieset van Rekenmachine II

  6. Hoe werkt een “loopje” nu precies? • Recapitulatie rekenmachine • Van rekenmachine naar rekenmachine met “loopjes”

  7. Uitbreiding instructieset met Branch-instructies: • Rekenkundige en logische instructies • ADD • SUB • AND • COPY • Immediate instructies (Instucties met één constant getal) • ADDI • SUBI • ANDI • LOADI • Branch instucties • BZ (Branch if zero) • BEQ (Branch if equal) • BRA (Branch always)

  8. Voorwaarden Branch-instructie Een sprong in een programma wordt alleen uitgevoerd als: - er een Branch-instructie geprogrammeerd is én - de Zero-uitgang van de ALU 1 is.

  9. Uitbreiding hardware • Componenten die de voorwaarden scheppen om een sprong mogelijk te maken. Dit zijn: • een Branch-bit; • een extra ALU-uitgang; (zero flag) • een AND-poort; • een LoadPC-ingang zodat de PC naar een andere waarde kan gaan de volgende; • een extra Adder om het adres te berekenen waar de PC naar toe moet springen.

  10. ALU met Zero-flag A Z 1 Y(y15, y14,….,y0) B

  11. Wanneer wordt een branch-instructie uitgevoerd? Evaluatie conditie(zero)

  12. Wanneer wordt een branch-instructie uitgevoerd? Evaluatie conditie(zero) • Ergelden twee voorwaarden: • Branch-instructie • Zero-flag is 1 (ALU-resultaat is 0) • De uitgang van de AND-poortwordtdan 1 en dezestuurtLoadPC

  13. Naar welke instructie springt de PC? Huidige waarde PC is 5; FFFD = -3; 3 instructies terug; Nieuwe waarde PC wordt 2

  14. Naar welke instructie springt de PC? Syntax:BEQ rs, rt, label Voorbeeld:BEQ $7, $5, label Betekenis: if (inhoud register 7 = inhoud register 5) goto label Welke operatie moet de ALU uitvoeren?

  15. Waarom is er een RegWrite-lijn nodig?

  16. Wanneer wordt er gesprongen? Clock ALU Zero Branch LoadPC tijd • Voorwaarden sprong: • Branch = 1 • Zero = 1 • Opgaande klokflank

  17. Wanneer wordt er gesprongen? Clock ALU Zero Branch LoadPC tijd • Voorwaarden sprong: • Branch = 1 • Zero = 1 • Opgaande klokflank

  18. Spikes & glitches spike glitch Clock ALU Zero Branch LoadPC tijd

  19. Toelichting opdracht 8Vermenigvuldigen op de basisschool Multiplicand a  1210 Multiplier b   1301               1210                0000                 3630                  1210       Product      1574210 

  20. Vermenigvuldigen binair Multiplicand a  1010 Multiplier b   1101                 1010                0000                 1010                  1010       Product      10000010 

  21. Vermenigvuldigen binair Multiplicand a  1010 Multiplier b   1101                 1010                0000   01010               1010                110010 1010       Product      10000010 

  22. Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010 Vermenigvuldigen binair

  23. Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010 Vermenigvuldigen

  24. Shifting & Masking Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010

  25. Shifting & Masking Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010 ADD mask, mask, mask = Shl 1, mask ADD a, a, a = Shl 1, a

  26. Shifting & Masking Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010

  27. Shifting & Masking Multiplicand a  1010 Multiplier b   1101                 1010               1010                110010 1010       Product      10000010

More Related