08 - Simple Computer Architecture (SCA) Flashcards
What bit width values does the simple computer work with?
It works with 14‐bit values.
How many onboard registers does the CPU have and what are their bit widths?
The CPU has five registers: A, B, and IR are 14-bit; PC is 8-bit; SR is 3-bit.
What is the role of the Control Unit (CU) in the simple computer?
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.
What does the ALU do in the simple computer?
It performs arithmetic and logic operations on the values in registers A and B and stores the result back in A.
How is main memory organized in the simple computer?
Main memory consists of 256 locations (addressed by 8-bit addresses), each storing a 14-bit value.
How does the CPU read a value from memory?
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 does the CPU write a value to memory?
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.
What is the role of the input and output units in the simple computer?
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.
What is the format of a machine language instruction in the simple computer?
Each instruction is 14 bits long, divided into a 5-bit opcode, a 1-bit mode, and an 8-bit address or operand.
What does the JUMPIFNOTZERO instruction do?
It loads the program counter (PC) with the specified address if register A is not zero.
What does the HALT instruction do?
It stops the CPU from executing further instructions until a reset occurs.
What is the largest unsigned integer the simple computer can process?
16383, which is 2^14 - 1.
Why is the PC register 8-bits wide in the simple computer?
Because main memory has 256 locations, and 8 bits are needed to address them.
What is assembly language?
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 does a single-pass assembler differ from a two-pass assembler?
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.
What are the two main addressing modes in assembly language?
Absolute addressing mode (directly using a fixed memory address or label) and relative addressing mode (using an offset relative to the current instruction pointer).
What is a label in assembly language?
A symbolic name assigned to a memory address, used to mark locations in a program for easier reference.
What are the three categories of processor instructions?
Data Transfer, Arithmetic/Logic Operations, and Program Sequencing and Control.
What does the opcode 0 (READ) do in the SCA?
It reads a value from the input unit into register A.
What does the opcode 1 (WRITE) do in the SCA?
It writes the value from register A to the output unit.
What is the difference between the LOAD A and LOAD B instructions?
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.
What operation does the ADD REG instruction perform?
It adds the values in registers A and B, storing the result back in register A.
What operation does the ADDI instruction perform?
It adds an immediate operand to either register A or B, storing the result back in the corresponding register.
What is the function of the JUMP instruction (opcode 17) in the SCA?
It unconditionally loads the program counter (PC) with the specified address, changing the flow of execution.
What is the purpose of the HALT instruction (opcode 18) in the SCA?
It halts the CPU, stopping further instruction execution until a reset.
What do the CALL (opcode 1A) and RETURN (opcode 19) instructions do?
CALL jumps to a specified address to execute a method, and RETURN returns from that method to resume the previous execution point.
What are the relative addressing instructions LOADREL and STOREREL used for?
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).
What information do the N, Z, and V bits in the status register (SR) provide?
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).
What are the main steps of the fetch-execute cycle in the simple computer?
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.
How does the MUL instruction operate in the SCA?
MUL multiplies the values in registers A and B and stores the result back in register A.
What is the function of the SUBI instruction in the SCA?
SUBI subtracts an immediate operand from either register A or B, storing the result back in that register.