Instruction Set Architecture Flashcards

1
Q

Address Space

A

Number of Drawers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Addressability

A

number of bits per drawer

drawer width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Decoder

A

Takes instruction apart (in case of LC 4, 16bit) and determines necessary control signals.
Translates instruction.
A Combinational logic block that computes control signals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ISA

A

Instruction Set Architecture
Programmer-visible components and operations
- Everything needed to create a program for CPU
- Serves as ‘contract’ between programmer and CPU designer
- Different implementations of the same ISA are ‘binary compatible’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ISA vs Microstructure

A

The ISA specifies the “interface” between the programs and the underlying computer hardware that must carry out the work for them. i.e. the ISA tells us what you can do with the computer, what operations it can perform, what data types, addressing modes etc. one can use with the particular computer.
Whereas the microstructure refers to the actual implementation, i.e. how this “interface” and the associated functionalities have been implemented under the hood.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

3 things specified by ISA / Basic components of ISA

A
  1. Instruction set: defined by its set of opcodes, data types (acceptable representations of information such that ISA has opcodes that can operate on
    that representation -> ISA supports that data type), and addressing modes (mechanisms for specifying where the operands are located. Usually in memory, in a register or as part of the instruction)
  2. Memory: how many locations, how many bits stored per location
  3. Registers: how many, what size, how are they used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

OpCode

A

the portion of a machine language instruction that specifies the operation to be performed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Processor Status Word Register (PSR)

A

16bit register where the lower 3 bits store the NZP bits. The PSR[15] stores the privilege level that the CPU is currently operating in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Program memory

A

where we store our instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

3 parts of NZP

A
  1. NZP tester (3bits out)
    ■ Tests the output of the ALU for negative, zero, or positive
  2. NZP register (3bits out, stored in the Processor Status-Word Register, bits [2:0])
    ■ Stores results of NZP tester (negative, zero, or positive)
    ■ NZP.WE = 1 for any instruction that writes to RegFile or PSR[15]
  3. TEST (1 bit out) if condition is satisfied
    ■ Top input: I[11:9] (3bit user condition)
    ● Example: >= 0, <=0, etc.
    ■ Bottom input: the output of NZP (previous ALU’s value’s negative, zero, or positive)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Binary Compatible

A

You can take same instructions, with same bits. You run it on 2 different CPUs, and while they might do things differently under the hood, the implementation is such that they will yield same result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Golden Rules of Branch Unit

Branch Unit = sets next PC value

A
  1. Every instruction updates PC to PC+1 unless otherwise noted
  2. NZP.WE = 1 for ANY instruction that writes to RegFile or PSR[15]
  3. We have never ‘X’ for WE control signals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Only instructions that can modify the privilege bit in PSR

A

TRAP and RTI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

LC 4 Memory

A

Adress Space = 2^16; 16bit address line
Addressability = 16bit
Memory partitioned into program and data memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

LC 4 Registers

A
Register File: General Purpose Regisets
- 8 registers, each 16-bit wide
Program Counter: 16bit
Processor Status-Word Register: 16 bit
- contains NZP condition codes
-Not directly accessible, but used and affected by instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Shift Arithmetic
Shift Logical
11010; 2 right

A

Logical: Zeros shifted into MSB
11010 -> 01101 ->00110

Arithmetic: MSB replicated on left, maintains 2C sign
11010 -> 11101 -> 11110

  • > A Left Arithmetic Shift of one position moves each bit to the left by one. The vacant least significant bit (LSB) is filled with zero and the most significant bit (MSB) is discarded. It is identical to Left Logical Shift.
  • > A Right Arithmetic Shift of one position moves each bit to the right by one. The least significant bit is discarded and the vacant MSB is filled with the value of the previous (now shifted one position to the right) MSB.
17
Q

Which compare instruction are useful in coding operation like: i>0, i<0 etc.

A

CMPI and CMPIU -> allow for immediate number to be included in instruction
But not CMP and CMPU

18
Q

Instruction that don’t modify the register file will not set the NZP bits?

A

Wrong, instructions might WRITE to reg file or set PSR[15] without modifying Reg file. Additionally, compare instructions do not impact reg file but still set NZP bits.

19
Q

How many cycles does LC4 need to execute one von Neumann loop

A

One Cycle. LC4 is a single cycle CPU

20
Q

What is advantage of separating Control Memory into Program Memory and Decoder

A

Before, whenever we added an new component the adressability of control memory was getting wider and wider
With splitting it into Program Memory and Decoder we can fix instruction length. We can add new control signals without changing instruction length.
Program Memory holds instruction without control signal data and
Decoder takes instruction apart and determines necessary control signals

21
Q

What CPU does during ADD

A
  1. Do ALU calculation and store result: R1 = R2 + R3
  2. Set NZP conditions codes: Figures out if ALU output is +, - or 0. Store result in Process Status Register
  3. Increment PC
22
Q

What does it mean for a CPU to be “single cycle”?

A

All steps in Van Neumann Model are done in one step