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

a working computer
SMART_READER_LITE
LIVE PREVIEW

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 &


slide-1
SLIDE 1

A working computer

Y86 CPU features

March 30, 2020 Patrice Belleville / Geoffrey Tien 1

slide-2
SLIDE 2

A working computer

  • Von Neumann architecture:

March 30, 2020 Patrice Belleville / Geoffrey Tien 2

Memory (contains program code and data) CPU (central processing unit) Control unit Arithmetic & logic unit Input/output

slide-3
SLIDE 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

slide-4
SLIDE 4

A working computer

  • Arithmetic & logic unit

– A combinational component which performs arithmetic and logical

  • perations

– 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

slide-5
SLIDE 5

A working computer

  • 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.

March 30, 2020 Patrice Belleville / Geoffrey Tien 5

Arithmetic & logic unit

𝑡𝑓𝑚 Function 𝑡𝑓𝑚 Function 0 0 0 𝑠𝑓𝑡 ← 𝐵 + 𝑑_𝑗𝑜 1 0 0 𝑠𝑓𝑡 ← 0…0 & 𝑑_𝑗𝑜 (𝑜 bits) 0 0 1 𝑠𝑓𝑡 ← 𝐵 + 𝐶 + 𝑑_𝑗𝑜 1 0 1 𝑠𝑓𝑡 ← 𝐶 + 𝑑_𝑗𝑜 0 1 0 𝑠𝑓𝑡 ← 𝐵 + ~𝐶 + 𝑑_𝑗𝑜 1 1 0 𝑠𝑓𝑡 ← ~𝐶 + 𝑑_𝑗𝑜 0 1 1 𝑠𝑓𝑡 ← 𝐵 and 𝐶 1 1 1 𝑠𝑓𝑡 ← 𝐵 or 𝐶 Exercise: Try to design this! Find common things that happen for specific select bits

slide-6
SLIDE 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

slide-7
SLIDE 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

slide-8
SLIDE 8

A working computer

March 30, 2020 Patrice Belleville / Geoffrey Tien 8

Partial Y86 execution path (not guaranteed to be accurate!)

slide-9
SLIDE 9

A working computer

  • 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

Y86 instructions

slide-10
SLIDE 10

A working computer

  • Sample program:

irmovl 0x3, %eax irmovl 0x35, %ebx subl %eax, %ebx halt

March 30, 2020 Patrice Belleville / Geoffrey Tien 10

Y86 instructions

slide-11
SLIDE 11

A working computer

  • 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

Y86 instructions