HPC 00 HW Basics
HPC 00 HW Basics
Your task:
What is printed at the command line?
You Computer
— Given: — Given:
List of ordered statements List of ordered instructions
— Interpretation: — Interpretation:
Read statement Read instruction
Understand statement Decode instruction
Execute statement Execute operation
Read next statement Read data
Understand next statement Calculate
Execute next statement Write result
… Read next instruction
…
Computer Instructions
stored in memory
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer Instructions
stored in memory
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer
— Given: sum=0 i=0 sum+=i i++ i<10?
Computer Instructions
stored in memory
— Given: sum=0 i=0 sum+=i i++ i<10?
— Includes all sorts of long term storage — Includes all busses within the computer
Hard drive SATA (Serial ATA)
Flash drive PCIe (PCI express)
… USB (Universal Serial Bus)
— Includes all devices for user interaction
Keyboard
Mouse
Digitizer
…
— Includes all devices to connect to the outside
world
(W)LAN card, bluetooth chip, …
Processor
Computer
mul store
Decoder
Fl. point
Processor
Computer
Computer
Cycle 0: Cycle 1:
Cycle 2: Cycle 3: Cycle 4:
• Read PC • Read instruction
• Process • Access • Write result to
• Access memory • Select execution unit
instruction memory registers
• Read instruction • Pass instruction
— Cycle 1:
Decode instruction 0 ready ready ready …
Fetch instruction 1 After
— Cycle 2: IF ID EX WB IF ID EX WB IF ID EX WB IF ID EX WB
Execute instruction 0 IF ID EX WB IF ID EX WB IF ID EX WB IF ID EX
Decode instruction 1
…
IF ID EX WB IF ID EX WB IF ID EX WB IF ID
Fetch instruction 2
IF ID EX WB IF ID EX WB IF ID EX WB IF
IF ID EX WB IF ID EX WB IF ID EX WB IF ID EX WB
IF ID EX WB IF ID EX WB IF ID EX WB IF ID EX
IF ID EX WB IF ID EX WB IF ID EX WB IF ID
IF ID EX WB IF ID EX WB IF ID EX WB IF
Processor
Computer
— Default: still have to wait if a single instruction stalls (e.g., due to memory access)
— What if there were instructions that could be executed?
— De-couple IF/ID with EX/WB
— Collect instructions
Mark them ready if their data is available
If ready, pass them to execution units
— Needs significant amount of processor space and management overhead
— According to ISA: Everything is still in-order!
Branch prediction
— Take notes on whether a branch was taken previously
— Take branch based on previous behavior
— Good for for-loops