a working computer
play

A working computer Y86 CPU features March 30, 2020 Patrice - PowerPoint PPT Presentation

A working computer Y86 CPU features March 30, 2020 Patrice Belleville / Geoffrey Tien 1 A working computer Von Neumann architecture: Memory (contains program code and data) CPU (central processing unit) Input/output Arithmetic &


  1. A working computer Y86 CPU features March 30, 2020 Patrice Belleville / Geoffrey Tien 1

  2. A working computer • Von Neumann architecture: Memory (contains program code and data) CPU (central processing unit) Input/output Arithmetic & logic Control unit unit March 30, 2020 Patrice Belleville / Geoffrey Tien 2

  3. A working computer • Memory – Each memory location (address) contains a fixed number of bits – Most commonly this number is 8 – Values that use more than 8 bits are stored in multiple consecutive memory locations • Characters use 8 bits (ASCII) or 16/32 (Unicode) • Integers use 32 or 64 bits • Floating point numbers use 32, 64, or 80 bits – Larger multi-byte values may need to be retrieved from memory over several clock cycles March 30, 2020 Patrice Belleville / Geoffrey Tien 3

  4. A working computer • Arithmetic & logic unit – A combinational component which performs arithmetic and logical operations – e.g. +, – , *, /, AND, OR, etc. – The function is chosen by multiplexers, select bits will be given by the control unit March 30, 2020 Patrice Belleville / Geoffrey Tien 4

  5. A working computer Arithmetic & logic unit • Assume that we already have functional circuit blocks to perform various operations such as AND, NOT, etc. – 𝑜 -bit inputs 𝐵 , 𝐶 1-bit input 𝑑_𝑗𝑜 3-bit select input – 𝑜 -bit output 𝑠𝑓𝑡 – each block can be represented as a subsystem with 𝑜 -bit inputs for 𝐵 , 𝐶 , and a 𝑜 -bit output – Using multiplexers, these functional blocks can be arranged in a circuit diagram to implement an ALU with some function select table, e.g. 𝑡𝑓𝑚 𝑡𝑓𝑚 Function Function 𝑠𝑓𝑡 ← 𝐵 + 𝑑_𝑗𝑜 𝑠𝑓𝑡 ← 0…0 & 𝑑_𝑗𝑜 ( 𝑜 bits) 0 0 0 1 0 0 𝑠𝑓𝑡 ← 𝐵 + 𝐶 + 𝑑_𝑗𝑜 𝑠𝑓𝑡 ← 𝐶 + 𝑑_𝑗𝑜 0 0 1 1 0 1 𝑠𝑓𝑡 ← 𝐵 + ~𝐶 + 𝑑_𝑗𝑜 𝑠𝑓𝑡 ← ~𝐶 + 𝑑_𝑗𝑜 0 1 0 1 1 0 𝑠𝑓𝑡 ← 𝐵 and 𝐶 𝑠𝑓𝑡 ← 𝐵 or 𝐶 0 1 1 1 1 1 Exercise: Try to design this! Find common things that happen for specific select bits March 30, 2020 Patrice Belleville / Geoffrey Tien 5

  6. A working computer • Control unit – A sequential device that controls the process of: • reading instructions and data from memory • deciding which instructions to execute • executing the instructions sequentially – not quite true, but this is how it appears to the user March 30, 2020 Patrice Belleville / Geoffrey Tien 6

  7. A working computer • Our working computer: – Implements the (fictional) Y86 architecture presented in the textbook by Bryant and O'Hallaron, used in CPSC 213 and 313 – A small subset of the IA32 (Intel 32-bit) architecture • The Y86 CPU has: – 12 types of instructions – One program counter (PC) register • contains the address of the next instruction to execute – 8 general-purpose 32-bit registers • used for temporary values we are currently working on – One 48-bit instruction register (IR) • used to hold pieces of an instruction while it gets retrieved from memory – Condition code register (CCR) • holds condition flags for the results of arithmetic operations March 30, 2020 Patrice Belleville / Geoffrey Tien 7

  8. A working computer Partial Y86 execution path (not guaranteed to be accurate!) March 30, 2020 Patrice Belleville / Geoffrey Tien 8

  9. A working computer Y86 instructions • Example instruction 1: irmovl 0x1A, %ecx – This instruction stores a constant value in a register – In this case, the value 1A (hexadecimal) is stored in %ecx – "immediate-register move 0x1A to %ecx " – The value 0x1A is "immediately" available as part of the binary instruction, and does not need to be retrieved from memory or a register • Example instruction 2: subl %eax, %ebx – The subl instruction subtracts it arguments – %eax and %ebx refer to source and source/destination registers – This instruction takes the value contained in %eax , subtracts it from the value contained in %ebx , and stores the result back in %ebx March 30, 2020 Patrice Belleville / Geoffrey Tien 9

  10. A working computer Y86 instructions • Sample program: irmovl 0x3, %eax irmovl 0x35, %ebx subl %eax, %ebx halt March 30, 2020 Patrice Belleville / Geoffrey Tien 10

  11. A working computer Y86 instructions • How does the computer know which instruction does what? – Each instruction is a sequence of 8 to 48 bits – The first 8 bits (icode/fcode) determine the instruction type • Control unit uses these bits to decide how many more bits need to be retrieved from memory to assemble the complete instruction • Also will allow the control unit to send the appropriate select signals to the various multiplexers in the CPU March 30, 2020 Patrice Belleville / Geoffrey Tien 11

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend