IC1 lab
Everything on the site to practice IC1 with nothing to install: the MIPS playground for the practical part and the simulators for the theory, in syllabus order. Each card says which topic it covers and what it helps you see.
sergio@learns:~/lab/ic1$ ls --by-topic
MIPS assemblythe practical part
Data representationpaper topics 2 to 7
- SM · C1 · C2One number, every formA number in binary, octal, hexadecimal, SM, C1, C2 and excess, and column sums with their carries and overflow
- Topic
- Number systems, binary arithmetic and two’s complement
- Helps you see
- The same number in all its forms at once and every sum column by column, with its carries and the moment it overflows, what gets lost among so many rows on paper.
$ number --bits 8 -58Review the theory: Number systems, binary arithmetic and two’s complement - s · e · mIEEE 754 explorerA number in IEEE 754 step by step, with the rounding, the value really stored and bits you can flip
- Topic
- IEEE 754 floating point
- Helps you see
- Where each bit of the word comes from and which number is really stored, with its rounding: the hexadecimal conversion of the exam question, checked.
$ ieee754 --single 37.6875 - p1 · p2 · p3Hamming liveHamming of any size: the parity groups, the bit you flip and the syndrome that finds it
- Topic
- Error detection and correction
- Helps you see
- Which positions each parity bit watches and how the syndrome points at the flipped bit; and what happens when two flip, something one example alone does not show.
$ hamming --even 0101 --flip 5 - BCD · Gray · UTF-8Codes: BCD, Gray and UTF-8BCD sums digit by digit with the +6 fix, Gray with its XORs and any text in ASCII and UTF-8
- Topic
- Codes: BCD, Gray and ASCII/Unicode
- Helps you see
- Why a BCD sum needs +6 in some digits and not others, why Gray changes a single bit and how a character’s bits are spread across UTF-8.
$ code --bcd 58 + 67
Instructions and processorpaper topics 8 to 11
- R · I · JMIPS instruction encoderEvery instruction, field by field in binary and hexadecimal, with the branch offset explained
- Topic
- The instruction set: R, I and J formats
- Helps you see
- Which bit goes in each field and where a branch offset comes from, what you do from memory on paper and helps you turn a routine into hexadecimal.
$ encode --from 0x00400000 routine.s - RD · señalesSingle-cycle datapathYour program through the single-cycle datapath: each instruction’s path, the value on every wire and the control signals
- Topic
- Single-cycle datapath and control unit
- Helps you see
- Your program cycle by cycle through the datapath: which wires each instruction uses, what value each carries and which signals the control unit sets, with the extensions from the problems.
$ datapath --extend addi,bne program.s - SPIM · 5 etapasMIPS pipelineYour MIPS code, run with SPIM, in the 5-stage pipeline: bubbles, forwarding and branches cycle by cycle
- Topic
- Pipelining
- Helps you see
- Your own MIPS code stage by stage: where each bubble goes, where each forwarded value comes from and what a branch costs, the diagram that is hard to draw on paper.
$ pipeline --forwarding on till.s
Memory, performance and I/Opaper topics 12 to 15
- 3 C · SVGCache step by stepThe split address and the cache access by access: hits and compulsory, capacity and conflict misses
- Topic
- Cache memory: direct-mapped and associative
- Helps you see
- How the address is split and which block stays in each line access by access, and why each miss is compulsory, capacity or conflict, as in the exam table.
$ cache --lines 8 --words 2 --ways 2 - CPI · Amdahl · DMAPerformance and I/OCPU time and average CPI, Amdahl’s law with its limit and how much CPU polling, interrupts and DMA take
- Topic
- Performance (CPI and Amdahl) and input/output
- Helps you see
- Why the processor with more MIPS can take longer, how much an improvement really gains and how much CPU polling, interrupts and DMA take.
$ performance --amdahl benchmark
