.131 WK 4-6 Flashcards
Architecture - Qiang Ni (47 cards)
Define ISA
interface between hardware + software - set of commands a processor can understand/execute
ALU provides…
registers (store operands + results), status flags (overflow, zero or negative)
ALU implements
arithmetic + logic operations
How to add 2 bits?
half adder aka S = A XOR B and S = A . B
How to add 3 bits?
full adder aka S = Cin XOR (A XOR B) Cout = A.B + Cin . (A XOR B)
What is the problem with ripple-carry adders and how to solve this?
slow as each stage has to wait for carry bit from above
can solve with carry select adders
How does a carry select adder work?
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
Benefit of a carry select adder?
effectively doubles the speed - can keep splitting as long as cost/space allows
What is a status flag?
bits organised into a special register called the flags register - can be zero, negative or overflow
How does an ALU identify an overflow?
inputs’ sign bits are the same but the result has a different sign
Cin ⊕ Cout = 1 = arithmetic overflow error
How does the ALU perform simple multiplication + division?
Can be done with repetitive adders (slow)
Bit shifting (only works for powers of 2)
How does bit shifting work?
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
What are the types of volatile memory?
dynamic and static
Dynamic volatile memory is…
used for main memory
slower but cheaper than static
Static volatile memory is…
used for registers + caches
fast so relatively expensive
Main memory
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
What ways can machine architecture organise mutli-byte words in memory?
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
What does big-endian mean?
multi-byte words are organised so the location with the lowest memory address holds the most-significant byte
What does little-endian mean?
multi-byte words are organised so the location with the lowest memory address holds the least-significant byte
How does static memory store bits
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
What does combinatorial logic entail?
outputs are purely a function of its inputs
What does sequential logic entail?
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
set-reset (S-R) flip-flop
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)
Limitations of S-R flip-flop
- 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)