.131 WK 4-6 Flashcards

Architecture - Qiang Ni

1
Q

Define ISA

A

interface between hardware + software - set of commands a processor can understand/execute

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

ALU provides…

A

registers (store operands + results), status flags (overflow, zero or negative)

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

ALU implements

A

arithmetic + logic operations

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

How to add 2 bits?

A

half adder aka S = A XOR B and S = A . B

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

How to add 3 bits?

A

full adder aka S = Cin XOR (A XOR B) Cout = A.B + Cin . (A XOR B)

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

What is the problem with ripple-carry adders and how to solve this?

A

slow as each stage has to wait for carry bit from above
can solve with carry select adders

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

How does a carry select adder work?

A

split problem by adding lower n/2 bits as usual but add upper n/2 bits using 2 full adders where one Cin is 1 and the other 0

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

Benefit of a carry select adder?

A

effectively doubles the speed - can keep splitting as long as cost/space allows

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

What is a status flag?

A

bits organised into a special register called the flags register - can be zero, negative or overflow

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

How does an ALU identify an overflow?

A

inputs’ sign bits are the same but the result has a different sign
Cin ⊕ Cout = 1 = arithmetic overflow error

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

How does the ALU perform simple multiplication + division?

A

Can be done with repetitive adders (slow)
Bit shifting (only works for powers of 2)

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

How does bit shifting work?

A

shifts number to left(multiply)/right(divide) by n^2
e.g shift left by 1 = x 2
shifts may be arithmetic, logical, rotate or rotate through carry

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

What are the types of volatile memory?

A

dynamic and static

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

Dynamic volatile memory is…

A

used for main memory
slower but cheaper than static

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

Static volatile memory is…

A

used for registers + caches
fast so relatively expensive

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

Main memory

A

each location holds 1 unit of info
identified by address (usually linear 0..n) which typically maps to multiple memory chips - address decoder maps linear addresses to specific location in a specific memory chip

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

What ways can machine architecture organise mutli-byte words in memory?

A

big-endian - location (byte) with the lowest memory address holds the most significant byte
little-endiain - location with the lowest memory address holds the least-significant byte

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

What does big-endian mean?

A

multi-byte words are organised so the location with the lowest memory address holds the most-significant byte

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

What does little-endian mean?

A

multi-byte words are organised so the location with the lowest memory address holds the least-significant byte

20
Q

How does static memory store bits

A

stored bits are organised into multi-bit storage slots called registers
use networks of logic components (NAND gates) to build storage for individual data bits

21
Q

What does combinatorial logic entail?

A

outputs are purely a function of its inputs

22
Q

What does sequential logic entail?

A

its outputs are a function of its inputs AND its current outputs
involves feedback of the outputs to the inputs which is the hook on which we hang memory

23
Q

set-reset (S-R) flip-flop

A

remembers its current state where Q0 = current + Q = next
high pulse on S -> Q=1(set)
high pulse on R -> Q=0 (reset)
(both S and R can’t be 1)

24
Q

Limitations of S-R flip-flop

A
  • has distinct set + reset inputs rather than a single input (could set state if 1 and reset if 0)
  • no way of telling the f-f exactly when it should store input data (would like a latch signal to supervise)
25
Q

Clocked D-type flip-flop

A

D = 1, L = 1 → Q = 1
Q0 = 1 but D = 0, L= 0 → Q = 1
Change D = 0 to set latch to 0

26
Q

D-type flip-flop limitation

A

need output enable to have closer control of when existing data leaves + new data arrives

27
Q

Master-slave flip-flop

A

slave is only readable where output enable is high pulse

if master latch = high → data signal is stored in master but slave is untouched
if master latch = low → data moves to slave

can implement registers using multiple master-slave flip-flops

28
Q

What is a bus?

A

bundles of wires that connect elements of VN architecture
one wire per bit

29
Q

What do the different buses do?

A

address bus - runs between CU and main memory to tell memory to access a specific address
data bus - runs between CU and main memory to send data
control bus

some processors may have internal + external buses (external may be narrower to reduce external pins + therefore cost)

30
Q

What is bus width?

A

number of bits that can be read/written to/from memory at once for data bus
amount of addressable memory for address bus

31
Q

Why do buses need output enable?

A

bus wires are shared so we must ensure there is only one active output at a given time

32
Q

Control Unit

A

“little program” running inside the processor that endlessly executes the fetch-decode cycle - controls sequences + other architectural modules using their respective control lines (e.g latch, output enable, function select, carry + shift L/R)

CU is driven by clock ticks/pulses

33
Q

How can CU fetch-ex loops be implemented?

A

as a FSM (hard-wired sequential logic - built directly in terms or NAND gates)
OR
as microcode (sequence of micro-instructions in a micro-memory)

34
Q

What are the pros + cons of each CU fetch-ex loop implementation?

A

FSM - high performance but expensive + hard to evolve
microcode - more flexible but slightly lower performance

35
Q

What is pipelining?

A

exploit inherent parallelism inside CU to speed up fetch-ex cycle
if split cycle into n-stages → get n x speedup

36
Q

What are the hazards associated with pipelining?

A
  • control hazards: occur when a control-transfer instruc. changes the flow of execution
  • data hazards: occur when instruc. n depends on a result from previous instruc. or when two parts of the pipeline need access to the same data
  • structural hazards: occur when two parts of the pipeline need access to the same piece of hardware
37
Q

What happens when we encounter a pipeline hazard?

A

may cause pipeline to “stall” so we must “flush” it to continue

might considerably reduce speedup

38
Q

I/O devices

A
  • input = keyboard, mouse, track ball, touch screen, camera, environmental sensor
  • output = display, printer, speaker, environmental actuator
  • input + output = network interfaces (ethernet, wifi, bluetooth, etc.), disks, audio cards, MIDI devices
39
Q

The I/O system enables…

A

attachment of I/O devices to the processor

40
Q

Challenges of I/O device connection

A
  • speed-gap challenge: I/O devices are often mechanical so run orders of magnitude slower than the CPU
  • device diversity challenge: differences like data-access modes (read-only/write-only/read-and-write, access by individual byte/block and access randomly/sequentially), device specific operations + I/O protocols
41
Q

What is a device driver?

A

software plug-ins inside the OS that abstract over device diversity by grouping sets of similar types of devices

42
Q

What do device drivers do?

A
  • register device with the OS + initialising it
  • initiate data transfers to/from a device
  • monitor status events from a device
  • manage device/system shutdowns so OS doesn’t stop till all unwritten data is stored + device is left in a safe state
43
Q

Two-fold classification (types) of device + device driver

A

character devices - send + receive 1 byte at a time - e.g. keyboard
block devices - send + receive multi-byte block at a time - e.g. hard disk

44
Q

Two-fold classification of processor support for I/O

A

isolated I/O - processor provides dedicated physical pins for the connection of I/O devices + dedicated instructions for I/O operations

memory-mapped I/O = devices sit within the CPU’s linear memory address space

45
Q

Pros + cons of memory-mapped I/O classification

A

simple, flexible programming model
but adds complexity to devices - need to understand larger addresses to work at memory speeds

46
Q

Pros + cons of isolated I/O classification

A

suited to simple devices
though having fixed set of special I/O instruc. doesn’t help w/ device diversity

47
Q

What is an example of isolated I/O classification?

A

Intel x86 instructions
- dedicated IN + OUT
- port addresses are typically 8 bits (narrower than main memory addresses)