08 - Simple Computer Architecture (SCA) Flashcards

1
Q

What bit width values does the simple computer work with?

A

It works with 14‐bit values.

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

How many onboard registers does the CPU have and what are their bit widths?

A

The CPU has five registers: A, B, and IR are 14-bit; PC is 8-bit; SR is 3-bit.

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

What is the role of the Control Unit (CU) in the simple computer?

A

The CU directs data movement within the CPU and between the CPU and external devices, controls ALU operations, and manages the program counter during the fetch-execute cycle.

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

What does the ALU do in the simple computer?

A

It performs arithmetic and logic operations on the values in registers A and B and stores the result back in A.

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

How is main memory organized in the simple computer?

A

Main memory consists of 256 locations (addressed by 8-bit addresses), each storing a 14-bit value.

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

How does the CPU read a value from memory?

A

It places an 8-bit address on the address bus, signals a ‘read,’ and then main memory outputs the corresponding 14-bit value onto the data bus.

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

How does the CPU write a value to memory?

A

It places an 8-bit address and a 14-bit value on the bus, signals a ‘write,’ and main memory stores the value at that address.

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

What is the role of the input and output units in the simple computer?

A

They interface with external devices: the input unit reads external data into register A, and the output unit writes data from register A to the outside world.

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

What is the format of a machine language instruction in the simple computer?

A

Each instruction is 14 bits long, divided into a 5-bit opcode, a 1-bit mode, and an 8-bit address or operand.

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

What does the JUMPIFNOTZERO instruction do?

A

It loads the program counter (PC) with the specified address if register A is not zero.

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

What does the HALT instruction do?

A

It stops the CPU from executing further instructions until a reset occurs.

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

What is the largest unsigned integer the simple computer can process?

A

16383, which is 2^14 - 1.

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

Why is the PC register 8-bits wide in the simple computer?

A

Because main memory has 256 locations, and 8 bits are needed to address them.

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

What is assembly language?

A

A low-level programming language with a strong correspondence to a computer’s machine code; it is hardware-specific and is translated into machine code by an assembler.

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

How does a single-pass assembler differ from a two-pass assembler?

A

A single-pass assembler translates the code in one pass without resolving forward references, while a two-pass assembler first builds a symbol table (collecting labels and addresses) and then translates the code, allowing for forward references.

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

What are the two main addressing modes in assembly language?

A

Absolute addressing mode (directly using a fixed memory address or label) and relative addressing mode (using an offset relative to the current instruction pointer).

17
Q

What is a label in assembly language?

A

A symbolic name assigned to a memory address, used to mark locations in a program for easier reference.

18
Q

What are the three categories of processor instructions?

A

Data Transfer, Arithmetic/Logic Operations, and Program Sequencing and Control.

19
Q

What does the opcode 0 (READ) do in the SCA?

A

It reads a value from the input unit into register A.

20
Q

What does the opcode 1 (WRITE) do in the SCA?

A

It writes the value from register A to the output unit.

21
Q

What is the difference between the LOAD A and LOAD B instructions?

A

LOAD A (opcode 2 with mode 0) loads a value from a specified memory address into register A, while LOAD B (opcode 2 with mode 1) does the same for register B.

22
Q

What operation does the ADD REG instruction perform?

A

It adds the values in registers A and B, storing the result back in register A.

23
Q

What operation does the ADDI instruction perform?

A

It adds an immediate operand to either register A or B, storing the result back in the corresponding register.

24
Q

What is the function of the JUMP instruction (opcode 17) in the SCA?

A

It unconditionally loads the program counter (PC) with the specified address, changing the flow of execution.

25
Q

What is the purpose of the HALT instruction (opcode 18) in the SCA?

A

It halts the CPU, stopping further instruction execution until a reset.

26
Q

What do the CALL (opcode 1A) and RETURN (opcode 19) instructions do?

A

CALL jumps to a specified address to execute a method, and RETURN returns from that method to resume the previous execution point.

27
Q

What are the relative addressing instructions LOADREL and STOREREL used for?

A

LOADREL (opcode 1C) reads a value from memory at address (SP + offset) into a register, while STOREREL (opcode 1D) writes a register’s value to memory at address (SP + offset).

28
Q

What information do the N, Z, and V bits in the status register (SR) provide?

A

N indicates a negative result, Z indicates a zero result, and V signals that an overflow occurred in the last ALU operation (with N as bit 0, Z as bit 1, and V as bit 2).

29
Q

What are the main steps of the fetch-execute cycle in the simple computer?

A

On reset, the PC is set to 0; then the CPU repeatedly fetches the instruction at the PC into the IR, increments the PC, decodes the instruction, executes it, and repeats until a HALT instruction is encountered.

30
Q

How does the MUL instruction operate in the SCA?

A

MUL multiplies the values in registers A and B and stores the result back in register A.

31
Q

What is the function of the SUBI instruction in the SCA?

A

SUBI subtracts an immediate operand from either register A or B, storing the result back in that register.