Architecture Flashcards

Carlos Reano

1
Q

What is computer architecture?

A

Science + art of selecting + interconnecting hardware components to create comp that meets functional, performance + cost goals.

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

What is below a program?

A

Application software written in HLL, system software & the hardware with the processor, memory + I/O controllers.

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

What is system software?

A

Compiler translates HLL code into machine code + operating system with service code deals with input/output, manages memory + storage, schedules tasks + shares resources.

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

What are the different levels of program code?

A

High level language, assembly language (textual rep of instructions + hardware representation (bits, encoded instructions + data)

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

What is HLL code?

A

High level language. Level of abstraction closer to problem domain + provides for productivity + portability.

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

What is an ISA?

A

Instruction set architecture. Describes aspects of comp architecture visible to low level programmer, including native datatypes, registers, instructions, addressing modes, memory architecture, interrupt + exception handling + I/O organisation.

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

What are the levels of computer architecture?

A

Abstraction, which helps us deal with complexity by hiding lower level details. ISA (hardware/software interface) then application binary interface (ISA + system software interface) + implementation (details underlying interface)

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

What is the Von Neumann model?

A

Shows components for all comps. Input, output, memory, datapath + control (sometimes combined as CPU/processor) Transistors found in processor, called chips.

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

What does the datapath do?

A

Performs operations on data.

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

What does the control do?

A

Sequences datapath + memory.

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

What does input/output include?

A

Network adapters for communicating with other comps.

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

What is the processor made up of?

A

Transistors made of silicon which is a semiconductor + materials added to it to transform its properties. They make up memory.

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

What is yield?

A

Proportion of working dies per wafer.

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

What is Moore’s Law?

A

Predicted that num of transistors that can be integrated on die would double every 1.5 to 2 years.

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

What is the memory wall?

A

Processor performance becomes faster than memory performance. Processing elements become fast + need more data to process but memory speed doesn’t improve as fast.

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

How do we overcome the power wall?

A

Can improve clock rate without increasing power by using muliprocessors/multicore processors. This means we have multiple processors on each chip. Requires explicitly parallel programming. Compare with instruction level parallelism, hardware executes multiple instructions at once, hidden from programmer. Hard to do as need high performance, load balancing, optimised comms + synchronisation.

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

What is response time?

A

How long it takes to do a task.

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

What is throughput?

A

Total work done per unit time.

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

What is the performance equation (n times faster)?

A

Performance = 1/execution time e.g. performance(x)/performance(y) = execution time(y)/execution time (x) = n times faster

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

What is the percentage change equation?

A

Percentage change = ((new – old)/old)*100. Positive result indicates increase whilst negative result indicates decrease.

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

What is elapsed time?

A

AKA system performance, total response time, including processing, I/O, OS overhead, idle time etc.

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

What is CPU time?

A

AKA CPU performance, time spent processing given job (discounts I/O time, other jobs’ shares). Comprises user CPU time + system CPU time. Diff programs affected differently by CPU + system performance.

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

What is a clock cycle?

A

Clock period/cycle = duration of clock cycle (in ps) 1/clock rate. Operation of digital hardware is governed by constant rate clock. 1 ms = 10-3 s, 1 us = 10-6 s, 1 ns = 10-9 s, 1 ps = 10-12 s

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

What is clock rate?

A

Clock frequency/rate = cycles per second (in GHz) 1/clock cycle. 1 kHz = 103 Hz, 1 MHz = 106 Hz, 1 GHz = 109 Hz, 1 THz = 1012 Hz. 1 Hz is 1 cycle per second.

25
Q

What is CPU performance + how is it improved?

A

CPU performance = CPU clock cycles x clock cycle time = clock cycles/clock rate
Improved by reducing num of clock cycles + increasing clock rate.

26
Q

What is the equation for clock cycles?

A

Clock cycles = instruction count x cycles per instruction

27
Q

What is the equation for CPU time?

A

CPU time = instruct count x CPI x clock cycle time = (inst count x CPI)/clock rate

28
Q

How is instruction count determined?

A

By programmer, ISA & compiler.

29
Q

How is CPI determined?

A

Average cycles per instruction (CPI) determined by CPU hardware. If diff instructions, have diff CPI. Average CPI affected by instruction mix. CPI varies between programs on given CPU.

30
Q

What does performance depend on?

A

Product. Minimise product, not isolated terms. E.g. ISA change to decrease instruction count but leads to slower clock.

31
Q

What is MIPS?

A

Millions of instructions per second. Doesn’t account for diffs in ISAs between comps or diffs in complexity between instructions.

32
Q

What is the equation for MIPS?

A

instruction count/(execution time x 106) =

33
Q

What is Amdahl’s law?

A

Improving aspect of comp + expecting proportional improvement in performance. F = fraction sped up + s = speedup on fract. E.g. T(improved) = (T(affected)/improvement factor) + T(unaffected)
Speedup = old time/new time = new rate/old rate.
S = 1/(1-x%) where x% speedup in percentage

34
Q

What is corollary?

A

Make common case fast.

35
Q

What is the ISA?

A

Repertoire of instructions supported by processor architecture, diff processor arcs have diff instruction sets but many aspects in common. Early processors had simple instruction sets, simplified implementation, modern processors can have simple instruction sets.

36
Q

What are the types of ISA?

A

2 types: CISC: Complex Instruction Set Computing. Complex instructions, less instructions per program, more cycles per instruction +/or seconds per cycle. + RISC: Reduced Instruction Set Computing. Simple instructions, more instructions per program, less cycles per instruction +/or seconds per cycle. E.g. x86 (CISC), ARM + MIPS (Microprocessor without Interlocked Pipelined Stages) (both RISC). We deal with ARM (LEGv8).

37
Q

How do we add and subtract?

A

Use 3 operands (2 sources + 1 dest) ADD a, b, c (a = b + c) or SUB a, b, c (a = b – c). Regularity = simpler implementation + simplicity = higher performance at lower costs. ADD = opcode (operation code). Operands = input/output data (source/dest). ADD f, t0, t1 -> Operands t0 + t1 are temp registers. 1 opcode, 2 inputs, 1 output. 1C statement = multiple instructions.

38
Q

Why don’t we use more complex instructions?

A

Practical reasons (performance + cost, not computability) + regularity improves both.

39
Q

What are register operands for?

A

Arithmetic instructions use them, LEGv8 has 32 register files of 64 bits, used for frequently used data. 64 bit data called doubleword, 31 x 64 bit gen purpose registers X0 to X30, reg X31 (XZR) = 0. 32 bit data called word, 31 x 32 bit gen purpose sub-registers W0 to W30. W31 (WZR) = 0.

40
Q

What are the general purpose registers?

A

X0 – X7 = procedure args/results. X8 = Indirect result location reg. X9 – X15 = Temps. X16 – X17 (IP0 – IP1) = May be used by linked as scratch reg or as temp reg. X18 = Platform reg for platform indep code or as temp reg. X19 – X27 = Saved. X28 (SP) = Stack pointer. X29 (FP) = Frame pointer. X30 (LR) = Link reg (return address).

41
Q

What is the datapath?

A

Datapath: CPU (datapath + control unit), control sequences datapath + memory, datapath performs ops on data (ALU (Arithmetic + logic unit), registers, interconnections.

42
Q

How is main memory used?

A

Composite data (arrays, structures, dynamic data) to apply arithmetic ops, load values from mem to regs, store result from reg to mem. Memory is byte addressed (each address identifies 8 bit byte). LEGv8 doesn’t require words to be aligned in mem, except for instructions + stack. E.g. LDUR (load reg from mem) + STUR (store reg in mem) U for unscaled offset (mem address offset provided not scaled).

43
Q

Why are registers better than memory?

A

Faster to access than memory, operating on mem data requires loads + stores (more instructions to be executed), compiler must use regs for variables as much as possible (only spill to mem for less frequently used variables, register optimisation is important). In CISC, mem to mem, LOAD + STORE incorporated in instructions. In RISC, reg to reg, LOAD + STORE are indep instructions.

44
Q

What are immediate operands?

A

Constant data specified in instruction, small constants are common, immediate operand avoids load instruction.

45
Q

How are instructions encoded?

A

In binary (machine code/language). LEGv8 instructions encoded as 32 bit instruction words, small num formats encoding opcode, reg nums.

46
Q

What are R-format instructions?

A

Register instructions. Instruction fields: Opcode (operation code), Rm (2nd reg source operand), shamt (shift amount, 00000), Rn (1st reg source operand) + Rd (reg dest).
e.g. ADD Rd, Rn, Rm (ADD X9, X20, X21). Machine code: = 8B150289 hex

47
Q

What are D-format instructions?

A

Data transfer instructions. Load/store instructions: address (constant offset from contents of base reg (+/- 32 doublewords), op2 (expands opcode field), Rn (base reg), Rt (dest (load)/source(store) reg num).
e.g. LDUR Rt, [Rn, addr} (LDUR X9, [X22, #64]

48
Q

What are the different formats of instructions for?

A

Complicate decoding but allow 32 bit instructions uniformly, keep formats as similar as possible.

49
Q

What are I-format instructions?

A

Immediate instructions. Rn (source reg) + Rd (dest reg) Immediate field is zero extended.
e.g. ADDI Rd, Rn, imm (ADDI X9, X9, 1)

50
Q

Where are instructions + data stored?

A

In mem, programs can op on programs (compilers, linkers), binary compatibility allows compiled programs to work on diff comps (standardised ISAs). Instructions for bitwise manipulation (useful for extracting + inserting groups of bits in word)
e.g. If LSL by 3, multiply by 8 because (23). If LSR by 3, divide by 8 because (23).

51
Q

What are shift operations?

A

R-Format: Shamt (shift amount) Shift left logical (shift left, fill with 0 bits, LSL by I bits multiplied by 2i). Same idea for shift right but divide.
e.g. LSL X11, X19, #4 (X11 = X19 &laquo_space;4 bits).

52
Q

What are AND + OR operations for?

A

AND useful for masking bits in word, select some bits, clear others to 0. OR/EOR ops (differencing ops, set some bits to 1, leave others unchanged.
Branch to labelled instruction if condition true, otherwise continue sequentially. CBZ reg, L1 (if (reg==0) branch to instruction labelled L1;

53
Q

What are procedure calls?

A

Procedure calls: Place parameters in register X0 to X7, transfer control to procedure, acquire storage for procedure, perform procedure’s operations, place result in reg for caller, return to place of call (address in X30/LR)

54
Q

What are jump and link and jump register?

A

Procedure call: jump + link. Puts address of following instruction in X30/LR, jump to target address. Procedure return: jump reg. Copies LR to PC. PC is reg with address of instruction in program being executed.

55
Q

What are the registers reserved on procedure calls?

A

Regs reserved on procedure calls: X9 – X17 (Temp regs, not preserved by callee (called procedure) on procedure call). X19 – X28 (saved regs, must be preserved on procedure call, if used, callee saves + restores them) Only 8 regs need for parameters X0 – X7. If need more, spill registers for mem.

56
Q

What is the data structure for spilling registers?

A

Data structure for spilling regs: Stack (LIFO queue, last in, first out), stack pointer (SP, X28, points most recently allocated address in stack), push (adds element to stack), pop (removes element from stack), stack grows from higher to lower addresses. Stack also used for procedure local variables not stored in regs (local arrays, structures).

57
Q

What is a procedure frame?

A

Procedure frame: segment of stack containing procedure’s saved regs + local variables, frame pointer (FP, X29, points first doubleword of PF).

58
Q

What is the memory layout?

A

Memory layout : Text (program code), static data (global variables e.g. string), dynamic heap (heap e.g. new), stack (automatic storage).