1/106
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Compiler
High-level language → Assembly
Assembler
Assembly → Machine language
5 classic components of a computer
input, output, memory, datapath, control
Memory
where programs and data are kept
datapath
performs arithmetic operations
control
tells datapath, memory, and i/o devices what to do according to program instructions
processor
active part of computer. adds numbers, tests numbers, signal i/o.
datapath and control combined
also called cpu
DRAM
dynamic random access memory.
takes same amount of time to access the memory no matter what portion of memory is read
cache
built using sram - static ram.
consists of small, fast memory that acts as buffer for DRAM
implementation
hardware that obeys the architecture design of principle technique
instruction set architecture
includes anything programmers need to know to make a binary machine language program work correctly, including instructions, i/o devices, etc.
integrated circuit
combines dozens to millions of transistors into a single chip
vlsi
very large scale integrated circuit, integrates hundreds of thousands to millions of transistors into a single chip
manufacturing of a chip
silicon crystal ingot → sliced into wafers → chopped into dies
defect
microscopic flaw in wafer.
any defect can cause failure
true
why chop wafer into dies?
allows discarding only defects rather than entire wafer
yield
percentage of good dies from total dies on wafer
each wafer same price, meaning fewer dies →
higher cost per die
each wafer same price, meaning
2x yield → half the cost per die
cost per die =
cost of wafer / (dies per wafer * die yield)
dies per wafer =
wafer area / die area
die yield =
(1 + (defects per unit area * die area) / alpha) ^ -alpha
what is alpha in die yield equation?
number of critical processing steps in manufacturing process. eg. MOS: alpha = 2
cpu execution time_1 =
cpu clock cycles * clock cycle time
cpu execution time definition
actual time the cpu spends computing for a specific task
cpu (execution) time_2 =
instruction count * cpi * clock cycle time
clock cycle time =
1/clock rate
performance =
1/execution time
A is n times as fast as B, n(performance) =
performace(A)/performance(B)
A is n times as fast as B, n(execution time) =
execution time(B)/execution time(A)
MIPS definition
millions of instructions per second
MIPS_1 =
instruction count / (execution time * 10^6)
MIPS_2 =
clock rate / (cpi * 10^6)
issues with MIPS
doesnt account for different instruction sets
varies between programs on same computer
if more instructions, but each instruction faster, mips increases but program may run slower
MFLOPS =
number floating point operations / (execution time * 10^6)
MFLOPS definition
millions of floating point operations per second
average execution time =
1/n * sum(execution time)
weighted arithmetic mean =
sum(w*execution time)
geometric mean =
nth root(product( execution time / execution time reference))
when to use geometric mean?
when averaging speedups
computer design principles
make common case fast
amdahl’s law
amdahl’s law =
exec time after improvement = execution time affected / amount of improvement + exec time unaffected
how many registers?
32
how many bits are instructions?
32
how many bits in each register?
64
how many bytes in memory space?
2^64
how many bits in a byte?
8
how many bits in a halfword
16
how many bits in a word?
32
how many bits in a doubleword?
64
arm is byte addressable
true
little endian
least significant byte at lowest address
instructions must be aligned to multiple of
4
B and CB type instruction branch offsets are
PC relative
PC relative
number of instructions from current instruction to label. + → foward, - → backward (before multiplying by 4)
assembly order of arguments is _ of machine code order
reverse
R type stands for
Register format
R type bit allocation
11:opcode, 5:second source, 6:shift amount, 5: first source, 5: destinition
R type examples
ADD, ORR, LSL, BR
I type stands for
Immediate arithmetic
I type bit allocation
10: opcode, 12: immediate, 5: source, 5: destination
I type examples
ADDI, ANDI
D type stands for
Data
D type bit allocation
11: opcode, 9: offset (signed), 2: op2, 5: base address, 5: load/store reg
D type examples
LDUR, STUR, LDURW, LDURSB
B type stands for
unconditional branch
B type bit allocation
6:opcode, 26: branch offset
B type examples
B, BL
CB type stands for
conditional branch
CB type bit allocation
8: opcode, 19: branch offset, 5: tested reg.
CB type examples
CBZ, CBNZ
describe MOVK
moves 16 bit immediate into destination register, can be LSL by multiple of 16, keeps other bits unchanged
describe MOVZ
moves 16 bit immediate into destination register, can be LSL by multiple of 16, zeros other bits
AND, ORR, EOR, ANDI, ORRI, EORI, etc. are bitwise operations
true
PC stands for what and explain what PC is
program counter, address of instruction to be executed, incremented by 4 after each execution, written over during branch instruction
which direction and operation are performed on stack pointer when allocating additional memory
sp growns down, SUB performed
what register is stack pointer SP in?
X28
what register is frame pointer FP in?
X29
what register is link register LR in?
X30
what register is the zero constant XZR in?
X31
For LDUR operations only, what is suffix to sign extend instead of default zero extend?
S
for LDUR and STUR operations, what is suffix to load/store a byte
B
for LDUR and STUR operations, what is suffix to load/store a halfword
H
for LDUR and STUR operations, what is suffix to load/store a word
W
for LDUR and STUR operations, what is suffix to load/store a doubleword
nothing
immediate addressing definition
operand is a constant within instruction
register addressing definition
operand is a register
base or displacement addressing definition
operand is at the memory location whose address is the sum of a register and a constant in instruction
PC-relative addressing definition
branch address is sum of PC and constant in instruction*4
how to get representation of a negative number in 2’s comp?
write as binary
invert all bits
add 1
how to extending numbers in 2’s comp representation?
extend sign bit
how to detect overflow?
when adding same sign, if result is different sign, overflow occured
how to do integer multiplication?
multiplicand * multipler
start: 0…0 | multiplier
check LSB of Product/Multiplier register
if 1: add multiplicand to product register
if 0: do nothing
shift P/M register right 1 bit
repeat register size amount of times
end: entire P/M register is result
note: only works on unsigned numbers
how to do integer division?
dividend / divisor
start: 0…0 | dividend
shift R/Q register left 1 bit, new bit shifted in unknown
subtract remainder register by divisor (add negative of divisor)
if remainder register nonneg: keep result, set new bit = 1
if remainder neg: restore before subtraction, set new bit = 0
repeat register size amount of times
end: remainder | quotient
IEEE floating point representation single precision bias
127
IEEE floating point representation single precision bit allocation
1: sign, 8: exponent, 23: fraction
IEEE floating point representation fraction should be normalized with hidden 1
true
given IEEE floating point representation, convert to value formula
(-1)^s * (1+fraction) * 2^(exponent - bias)
IEEE rounding: round to nearest
even