TIEP 114 Tietokoneen rakenne ja arkkitehtuuri 3 op







- Slides: 7
TIEP 114 Tietokoneen rakenne ja arkkitehtuuri, 3 op CPU
comp C-instruction jump dest Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 Muisti (Memory. hdl) load 1 Muisti (Memory) in 0 16 Datamuisti (RAM) (16 K) out address 15 16 2^14 Näyttö - Screen (8 K) Keyboard (1) Nouda käsky Suorita käsky
comp C-instruction dest jump Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 in. M Datamuistista (RAM) @i M=1 @sum M=0. . . instruction 00000010000 1110111111001000 00000010001 111010001000. . . 16 reset Nouda käsky 1 CPU Ohjelmamuistista (ROM) 16 16 1 15 15 out. M write. M Datamuistiin (RAM) address. M pc Suorita käsky Ohjelmamuistiin (ROM)
comp C-instruction dest jump Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 • Prosessorin toimintalogiikka – Käsky (instruction[16]) tulkitaan • Jos A-käsky, niin – Viedään instruction[16] A-rekisteriin • Jos C-käsky, niin selvitetään biteistä – – ALU: lle komento Rekisterien/muistin sisällön vienti ALU: lle ALU: n ulostulon tulkinta ja tallennus (rekisteriin/muistiin) Hyppy ehdon täyttyminen? » Asetetaan A-rekisterin arvo PC: n uudeksi arvoksi » Jos ei hypätä niin PC = PC+1 – Käskyn suorituksen jälkeen noudetaan PC: n osoittama seuraava käsky Nouda käsky Suorita käsky
comp C-instruction dest jump Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 instruction[15]. . . instruction[0] (a=0) 0 1 -1 D A !D !A -D -A D+1 A+1 D-1 A-1 D+A D-A A-D D&A D|A c 1 c 2 c 3 c 4 c 5 c 6 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 0 1 0 1 (a=1) M !M -M M+1 M-1 D+M D-M M-D D&M D|M d 1 d 2 d 3 0 0 0 1 1 1 0 0 1 1 1 Mnemonic null M D MD A AM AD AMD Destination (minne tallennetaan) Operaation tulosta ei tallenneta Memory[A] (RAM muistipaikka A) D register Memory[A] and D register A register and Memory[A] A register and D register A register, Memory[A], and D register j 1 j 2 j 3 (out < 0) (out = 0) (out > 0) Mnemonic 0 0 0 null 0 0 1 JGT 0 1 0 JEQ 0 1 1 JGE 1 0 0 JLT 1 0 1 JNE 1 1 0 JLE 1 1 1 JMP Effect No jump If out > If out = If out ≥ If out < If out ≠ If out ≤ Jump 0 0 0 jump jump
comp C-instruction jump dest Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 Prosessori (CPU. hdl) C C A out. M ALU in. M D C Mux instruction Mux decode C C C write. M address. M C reset PC pc
comp C-instruction dest jump Binäärinen: 1 1 1 a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3 Tietokone (Computer. hdl) 0 Ohjelmamuisti (ROM) (32 K) in. M out. M 16 16 16 reset 1 CPU instruction 1 15 write. M Datamuisti (RAM) (16 K) address. M pc 15 Näyttö (8 K) Näppäimistö (1) 2^15 reset Nouda käsky Suorita käsky







