Machine Instructions & Pipelining

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

36 Terms

1
New cards

Three parts of the CPU?

ALU, control unit, register unit.

2
New cards

What does the ALU do?

Performs arithmetic operations

Performs logical operations

3
New cards

What does the control unit do?

Fetches and Decodes Instructions.

Sends control signals to other parts of the CPU and the system.

Coordinates the execution of instructions.

4
New cards

What does the Register Unit do?

Provides high speed temporary storage for data, instructions and memory addresses that the processor is actively using or calculating.

5
New cards

Two kinds of registers?

  • General-purpose (hold data)

  • Special-purpose (e.g., PC, IR).


6
New cards

What is a bus?

The pathway connecting the CPU, main memory and other units.

It allows data, instructions and control signals to be transmitted between the CPU, memory and other devices.

7
New cards

Describe the Stored-program concept?

A program encoded as bit patterns and stored in main memory; changing the program means changing memory contents, not rewiring the CPU.

8
New cards

Machine instruction vs machine language?

A machine instruction is an instruction encoded as a bit pattern the CPU recognises whereas machine language is the set of all instructions recognised by the cpu.

9
New cards

RISC vs CISC?

RISC and CISC are design approaches used for computer processor instruction sets.


RISC: focuses on using a smaller number of simple, efficient and fast instructions. Eg. ARM chips in smartphones.

CISC: focuses on providing a larger set of powerful and convenient instructions. Eg. Intel x86 processors used in traditional computers

10
New cards

Three instruction categories?

Data transfer (LOAD, STORE),

Arithmetic/logic (ADD, AND, SHIFT, ROTATE),

Control (JUMP, BRANCH)

11
New cards

Op-code vs operand?

The opcode and operand are the 2 parts of a vole instruction.

The opcode indicates which operation to execute. The operand provides more detail about the operation, its meaning depends on the op-code.

12
New cards

What is the size of a Vole instruction?

One vole instruction is 4 hexadecimal digits or 16 bits. It has a 4-bit op-code and a 12-bit operand.

13
New cards

What does the program counter hold?

The program counter stores the memory address of the next instruction to be fetched and executed by the computer’s CPU.

14
New cards

What does the instruction register hold?

The instruction register stores the current instruction that is actively being decoded or executed by the CPU.

15
New cards

What are the steps of the Machine Cycle?

FI - fetch instruction

DI - decode instruction

FO - fetch operand

EX - execute

WO - write operand

16
New cards

How does JUMP work?

Given JUMP’s opcode and operand: 0xB| RXY


The bit pattern in register R is compared with the bit pattern in register 0.

If they are equal: XY is copied into the program counter during the execute phase, so the next instruction fetched is the one at address XY.

Otherwise nothing happens and execution continues in normal sequence.


17
New cards

Why does the PC increment by 2 in Vole?

Each memory cell holds half an instruction, so two cells are fetched.

18
New cards

What is masking?

Using logic operations (AND/OR/XOR) to isolate or change selected bits of an operand.

19
New cards

Logical vs arithmetic shift?

Logical shift pads with 0.
Arithmetic shift pads with the sign bit.

20
New cards

What is a rotate?

A circular shift: bits pushed off one end re-enter at the other.

21
New cards

What is a controller?

A controller is a unit that handles communication between the computer and a peripheral device.

It can be specialised for one type of device, or general-purpose (e.g., USB, HDMI).

22
New cards

What is a port?

A port is the point at which a device connects to a computer.

23
New cards

What is memory-mapped I/O?

Memory-mapped I/O is a method where devices appear to the CPU as memory locations.

24
New cards

What is DMA?

Direct memory access: a controller accesses main memory over the bus.

25
New cards

Von Neumann bottleneck?

CPU and controllers compete for bus access.

26
New cards

What is handshaking?

Coordinating the transfer of data between the computer and a peripheral.

27
New cards

Parallel vs serial communication?

Parallel communication sends several signals at once on separate lines.
Serial communication sends signals one after another on a single line.

28
New cards

Bandwidth (in this context)?

Bandwidth in the context of data communication is the maximum available data-transfer rate.

29
New cards

What is pipelining?

Pipelining is a technique where the steps of the machine cycle for multiple instructions are overlapped allowing more than one instruction to be processed at the same time.

30
New cards

Why does pipelining work?

Each stage uses a different part of the CPU, so parts can work on different instructions at the same time (instruction-level parallelism).

31
New cards

Speed-up formula?

Non-pipelined time ÷ pipelined time.

32
New cards

SISD, SIMD, MISD, MIMD?

SISD: no parallelism.
SIMD: same program, different data.
MIMD: different programs, different data.
MISD: may be pipelined computers.

33
New cards

SIMD vs MIMD?

SIMD: one instruction stream applied to many data streams.

MIMD: many instruction streams on many data streams.

34
New cards

What happens during the FETCH stage?

The CPU reads the cell at the address in the PC and the cell after it,

puts the full instruction in the IR,

then increments the PC by 2.

35
New cards

What happens during the DECODE stage?

The CPU interprets the bit pattern in the IR

and splits it into the opcode and the operands.

36
New cards

What happens during the EXECUTE stage?

The CPU performs the action required by the instruction in the IR.

For a jump, it overwrites the PC with the new address. That is how a loop goes back.