Exam 2 Flashcards
ISA
Specifies the software interface to the CPU
(Instructional Set Architecture)
Microarchitecture
- hardware design of a physical CPU
- an implementation of an ISA
Control
Tells everything else what to do and when
- decode the instruction and set all the control signals to make that instruction happen
- automatically sets the control signals to the right values to make each instruction happen
Registers
- Hold the values being computed
- temporary stopping point for your program’s data
ALU
Computes new values from old values
Arithmetic and Logic Unit
Values move between what
Registers and ALU
Architectural Registers
- registers that the ISA specifies
- GPR < Architectural < Microarchitectural
GPR
registers you can use for any purpose in programs
- General Purpose Registers
Microarchitectural registers
- exist outside the ISA and are part of the implementation of the CPU
- used for temp storage, implement multistep operations, control specific features, etc.
- Often inaccessible from software
Register File
- Holds General-purpose registers
- like an array of registers or small word addressed memory
PC register
- part of the control
- says what step to do next
PC
memory address (send it to memory)
- memory sends back data (instruction) and the control decodes the instructions and tells things what to do
Program Counter
CPU’s Job
to read and execute instructions
(Fetch, Decode, Execute (Once per instruction))
Fetch
gets the next instruction to execute from memory by using PC
- Instruction memory
Decode
Control reads the instruction
- look at the fetched instruction and set control signals
Control/Register File
Executes
The control does the instruction by telling other parts what to do
- wait for data to flow through the ALU
ALU
how many times is memory accessed for a load or store?
-1st access: to fetch instruction
-2nd access: to actually load the value
Schematic
Graphical way to represent systems (flowcharts)
HDL
Hardware Description Languages (text)
EDA
Electronic design automation (schematics)
Schematics and texts are…
equal in power
Circuit schematics show…
how data flows from one component to another
components can
produce or consume values (or both)
Is there order in circuit schematics?
NO
everything in the circuit happens simultaneously
Boolean Function
takes one or more Boolean (t/f) inputs and produces a Boolean output
truth table
summarizes a Boolean function by listing the output for every possible combination of inputs
gate
implements one of the basic Boolean logic functions
What can all computation be built from
All computation can be built from just the basic Boolean logic operations (AND, OR, and NOT)
Add two three-bit numbers
- need three one bit adders
- chain the carries from each place to the next higher place
Propagation Delay
every gate and wire has it
- the amount of time needed for a signal to “propagate” through it
ripple carry
linear in the number of bits
- if you double number of bits, double the amount of time needed
overflow
Get a number too big to be represented and it gets wrapped around
If you add two n-digit numbers in any base…
the result will have at most n + 1 digits
3 options to deal with overflow
- store
- ignore
- fall on the floor (crash)
Ignore option
- worst and most common way to respond to overflow
Crash option
- better than ignoring
- generates CPU Exception (can be detected and handled)
Arbitrary Precision Arithmetic
two 8-bit adds, starting with LSB
- the carry bit from the first add is carried into the second add
- can keep chaining them together
overflow in unsigned addition
in unsigned addition, if the MSB has a carry out of 1, an overflow happened
overflow in signed addition
in signed addition, overflow occurs if we add two numbers of the same sign and get the opposite sign
signed subtraction
same as signed addition, apply the rule after doing the negation
overflow for unsigned subtraction
overflow occurs when the MSB’s carry out is 0 not 1
overflow for signed subtraction
same as addition, but check after negating second input
two paths can be done…
at the same time
when making a decision in hardware you…
do all possible things, then pick only the thing you need, and ignore the rest
Multiplexer
(mux)
- outputs one of its inputs based on t=a select input
Demultiplexer
(Demux)
- opposite of multiplexer
(with very few exceptions, you won’t need these)
negate means
change the sign to the opposite
shifting left by n is the same as…
multiplying by 2^n
shifting right by n is the same as…
dividing by 2^n
Arithmetic Right Shift
used for signed numbers
- “smears” the sign bit into the top bits
(pushes 1s in the left place while scooting right)
And
intersection
set of things that are in both sets
Or
Union
the set of things that are in either set
XOR
Symmetric set difference
set of items in one set but not both