Assembly Language Flashcards

1
Q

What is the Von Neumann Architecture?

A

Itis archietecture model which is a concept of storing both data and instructions in the same memory space.

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

What are the main components of the CPU in the von Neumann Architecture?

A
  • Control Unit
  • Arithmetic and Logical Unit (ALU)
  • Registers (including Program Counter, Instruction Register, Address Register, Accumulator)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the roles of the Program Counter, Instruction Register, and Address Register in the CPU?

A

Program counter - Address of the NEXT Instruction

Instruction register - Instruction CURRENTLY being executed or decoded

Address register - either stores the memory address from which data will be fetched, or the address to which data will sent and stored

Accumulator - SHORT - term, intermediate storage of arithmetic and logic data computations

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

What is the role of the Accumulator in the CPU?

A

It serves as short-term, intermediate storage for results of arithmetic and logic computations.

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

What is a system bus?

A

It is a set of physical connection which allows communication between the CPU, memory, and input/output devices.

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

What are the three types of system buses in the von Neumann Architecture, and what do they carry?

A
  1. Control Bus - Carries commands from the CPU and returns status signals from the devices
  2. Data Bus - carries the actual data
  3. Address bus - carries memory addresses from the processor to other components
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the role of Memory (RAM) in the von Neumann Architecture?

A

It stores both data and instructions temporarily while the system is running.

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

What is the purpose of Input/Output Units in the von Neumann Architecture?

A

They allow the CPU to communicate with external devices like keyboards, screens, and storage drives.

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

What does the clock cycle do in the Von Neumann Architecture?

A

It provides a high/low oscillating signal to synchronize (coordinate) CPU actions.

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

How does the clock affect CPU performance?

A
  • The number of clock cycles per second determines CPU speed, measured in megahertz (MHz) or gigahertz (GHz).
  • The rate of the Fetch/Execute Cycle is controlled by the computer’s clock.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How much time does a 1 GHz clock give between ticks, and what happens during that time?

A

One nanosecond per tick; the CPU tries to start the Fetch/Execute Cycle in that time.

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

What is pipelining in computer architecture?

A

Pipelining is when completing an instruction is handed off to other circuitry, allowing the fetch unit to start the next instruction before the current one finishes.

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

Why is it not exactly true that 1,000 instructions execute in 1,000 clock ticks?

A

Because even with pipelining, overlaps and delays mean that instructions aren’t completed perfectly one per tick.

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

What are the structures in the Harvard Architecture?

A
  1. Separate memory for instructions and Data
  2. Parallelism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the purposes of the two structures in the Harvard Architecture?

A
  1. There are two memory spaces inline VNA, where one is for instructions and the other one for data
  2. Instructions and data can be fetched at the same time, leading to faster execution.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the MIPS R4000, and how does it differ from the von Neumann architecture?

A

The MIPS R4000 is a microprocessor without interlocked pipeline stages. It is similar to von Neumann but has separate interfaces for instructions and data, resembling a modified Harvard architecture.

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

What is the significance of the “modified Harvard architecture” in the MIPS R4000?

A

It allows separate handling of instructions and data, improving performance by reducing bottlenecks in data processing.

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

What are the key features of the MIPS R4000 microprocessor?

A
  • First 64-bit architecture.
  • Integrated caches (on-chip and off-chip secondary cache).
  • Integrated Floating Point Unit (FPU).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What was the performance and technical setup of the MIPS R4000 when it was implemented in 1992?

A
  • Deep pipeline.
  • 1.4 million transistors.
  • Initially 100 MHz with over 50 MIPS performance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What makes the MIPS R4000 programming model simple and efficient?

A

It has a compact set of instructions with a regular format (MIPS III), making it easy to translate high-level code to machine language.

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

Where is the IF tag check done in the MIPS R4000 pipeline?

A

The IF tag check is performed in the Register File (RF) stage.

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

What happens in the IF and IS stages of the MIPS R4000 pipeline?

A

IF: First half of instruction fetch; PC selection and initiation of instruction cache access.
IS: Second half of instruction fetch; completes instruction cache access.

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

What occurs during the RF and EX stages in the MIPS R4000 pipeline?

A

RF: Instruction decode, register fetch, hazard checking, and instruction cache hit detection.
EX: Execution; includes effective address calculation, ALU operations, branch target completion, and data cache access.

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

Describe the functions of the DF, DS, TC, and WB stages in the MIPS R4000 pipeline.

A

DF: First half of data cache access.
DS: Second half of data fetch; completes data cache access.
TC: Tag check to determine whether the data cache access hit.
WB: Write-back for loads and register-register operations.

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

What are the main components of the MIPS R4000 processor?

A
  • Program counter
  • Instruction register
  • Control unit
  • Floating Point Unit (FPU)
26
Q

How are the registers organized in the MIPS R4000, and what are their key functions?

A
  • 32 x 32-bit/64-bit registers, denoted $0-$31 (or r0-r31).
  • $0 (r0): Always stores 000…000.
  • $31 (r31): The link register used by Jump and Link instructions (should not be used by other instructions).
27
Q

How does the Arithmetic and Logic Unit (ALU) in the MIPS R4000 function?

A
  • Takes input from up to two registers.
  • Sends output only to registers (except when calculating memory addresses).
28
Q

What is the typical process for running a program written in a high-level programming language?

A

High-level languages are compiled into assembly language, which is then assembled into binary code that the computer can execute.

29
Q

Why are high-level programming languages preferred?

A

They offer special statement forms that help programmers describe complex tasks more easily.

30
Q

What do computers actually understand, and what is the machine level?

A

Computers understand machine-level programs, which are made up of complex combinations of simple instructions

31
Q

What is an Instruction Set Architecture (ISA)?

A

An ISA is the unique set of instructions that a particular machine can understand and execute.

32
Q

What does the instruction set represent to a programmer?

A

It is the set of operations the CPU can execute — the “tools” a programmer sees and uses to control the machine.

33
Q

How do high-level and low-level programs differ in terms of instructions?

A
  • High-level programs describe what and how tasks should be done.
  • Low-level programs also specify where operations happen (e.g., specific memory addresses or registers).
34
Q

What form must software be in for a computer to execute it?

A

Software must be in binary object code (strings of 0’s and 1’s).

35
Q

What is assembly language, and why is it used?

A

Assembly language is a human-readable alternative to machine language that uses letters and normal numbers to make programming easier.

36
Q

How does a computer process assembly code into binary object code?

A
  1. Scans the assembly code.
  2. Looks up words in a table to convert to binary.
  3. Converts numbers to binary.
  4. Assembles the binary pieces into complete instructions.
37
Q

What is MIPS Assembly Language, and who created it?

A

MIPS is a RISC (Reduced Instruction Set Computer) architecture created by John Hennessy and a team at Stanford University in the early 1980s.

38
Q

How does “Simplicity Favours Regularity” apply to MIPS instruction formats?

A

All MIPS instructions are the same length (32 bits) and follow a fixed format with a small number of fields, making decoding easier and hardware design simpler.

39
Q

How does MIPS maintain consistency in operand usage?

A

MIPS uses a fixed number of operands—typically two source operands and one destination operand—which speeds up hardware performance and reduces complexity.

40
Q

What does “Make the Common Case Fast” mean in MIPS architecture?

A

MIPS optimises frequently used instructions like arithmetic and load/store operations, while complex instructions are broken down into simpler ones.

41
Q

How does the Load/Store architecture contribute to MIPS efficiency?

A

In MIPS, all operations (except load and store) occur between registers, with memory access only through LW (load word) and SW (store word) instructions, simplifying execution and speeding up common operations.

42
Q

How does having a limited number of instructions make MIPS faster?

A

Using a small, simple instruction set reduces hardware complexity, allowing for faster instruction execution.

43
Q

Why does MIPS use only 32 general-purpose registers?

A

32 registers balance performance and simplicity — enough to reduce memory access without making instruction decoding and execution slower.

44
Q

How does MIPS apply the idea that “Good Design Demands Good Compromises”?

A

MIPS, as a RISC architecture, prioritizes simple and fast instructions over complex ones, balancing hardware simplicity with software flexibility.

45
Q

How does pipelining represent a design compromise in MIPS?

A

Pipelining increases instruction throughput but requires balancing longer pipelines with managing hazards from instruction dependencies.

46
Q

Why do computers use registers, and how many does MIPS have?

A

Registers provide fast storage for binary operands because main memory (RAM) is slow. MIPS has 32 fast registers.

47
Q

How are MIPS registers named, and what is special about register 0?

A

MIPS registers start with a “$”, e.g., $0 is “register zero” and always holds the constant value 0.

48
Q

What are the specific uses for the $s and $t registers in MIPS?

A
  • $s0-$s7 are used to store variables.
  • $t0-$t9 are used for holding intermediate values.
49
Q

Why do MIPS registers have limited space for data, and how is this issue handled?

A

MIPS has only 32 registers, which are small in number. To handle larger data, memory is used, but it’s slower than registers.

50
Q

What is the best practice for using registers and memory in MIPS?

A

Frequently used variables are kept in registers, while a combination of registers and memory is used to access large amounts of data quickly.

51
Q

How does the memory address calculation work with the sw (store word) instruction in MIPS?

A

The memory address is calculated by adding an offset to the base address stored in a register:
address = base_register + offset.

52
Q

Can the offset in the sw instruction be written in different formats?

A

Yes, the offset can be written in either decimal (default) or hexadecimal format.

53
Q

What are three MIPS instruction types?

A
  1. I-type (Immediate)
  2. R-type (Register)
  3. J-type (Jump)
54
Q

What does each MIPs instruction types require?

A
  • Immediate require one or two registers and a value
  • Register require three registers
  • Jump require a value
55
Q

What are the three main register operands in an R-type MIPS instruction?

A
  • Source1 and Source2: Source registers
  • Dest: Destination register
56
Q

What other fields are part of the R-type MIPS instruction format?

A
  • Opcode: Operation code (0 for R-type instructions)
  • Shift: The shift amount (0 if not a shift instruction)
  • Func: The function to be performed (e.g., add, subtract, etc.)
57
Q

What are the operands in an I-type MIPS instruction?

A
  • Source1 and Dest: Register operands
  • Value: A 16-bit immediate value
58
Q

What is the role of the Opcode in an I-type instruction?

A
  • The Opcode specifies the operation to be performed. Different operations have different Opcodes.
59
Q

What is the key operand in a J-type MIPS instruction?

A

The key operand is a 16-bit value, which represents the jump target address.

60
Q

The key operand is a 16-bit value, which represents the jump target address.

A

The Opcode specifies the jump operation. Different jump operations have different Opcodes.