Hardware 2 Flashcards

1
Q

Control Unit (CU)

A

The part of the CPU responsible for directing electrical signals to the computer, in order to execute program instructions.

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

Arithmetic Logic Unit (ALU)

A

The part of the CPU responsible for performing arithmetic and logical operations.

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

Registers

A

The CPU has its own memory, called memory registers. These are actually even faster to use than RAM because they are physically inside the CPU and therefore the electrical signals have a shorter distance to travel.

Size is dependent on architecture, i.e. 32-/64-bit systems.

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

Downsides of Registers

A

There are a limited number and they can hold an extremely limited amount of data.

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

Types of Registers

A

Special Purpose: Intended for one specific task

General Purpose: Can be used by programs as they’re compiled and turned into machine code to do all manners of tasks.

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

Extended Accumulator Register (EAX)

A
32-bit wide register
Designed to be the "calculator" on the system
Can reference portions of it:
- AX for (lower) 16 bits
- AH/L for higher/lower 8 bits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Extended Instruction Pointer (EIP 32-bit, RIP 64-bit)

A

Designed to hold the memory address of the next instruction to be executed. Used to direct the CPU to find the next bit of code.

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

Stack Pointer Register (ESP)

A

Contains a memory address which points to the top of the current stack frame in RAM.

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

Base Pointer Register (EBP)

A

Contains a memory address which points to the bottom of the current stack frame in RAM.

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

Source Index Register (ESI)

A

Typically used to hold a memory address of data when that data is being used as a source in an operation.

For example, if you are copying data from one location to another, ESI will contain the memory address of the data you are copying.

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

Destination Index Register (EDI)

A

Typically used to hold a destination memory address.

If you were to copy data from one location to another, EDI holds the memory address that the data is going to be copied into.

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

Fetch-Decode-Execute (FDE) Cycle

A
  1. The control unit ‘fetches’ the next instruction from RAM.
  2. The control unit ‘decodes’ the instruction and retrieves the necessary data from memory and places it into the arithmetic logic unit (ALU) of the CPU.
  3. The arithmetic logic unit (ALU) ‘executes’ the instruction, and operates on the data provided in the previous step.
  4. The arithmetic logic unit stores the result of the execution either in a memory register or RAM.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Sections of RAM

A

Stack & Heap

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

Stack

A

Very structured and orderly memory section

Program instructions are loaded onto the stack and each function is assigned a ‘stack frame’ (memory area). The stack frame contains local variables used by the function.

At the bottom of the stack frame is the return pointer.
When the CPU enters a function, it will save the previous value of EIP to the bottom of the stack frame

When the CPU gets a ‘return’ instruction, it will load the return pointer from the bottom of the stack frame into EIP and leave the function.

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

Heap

A

Unstructured area of memory that can be used to store data.

Slower to access than the stack, but you can store whatever you like without knowing beforehand the size of the data.

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