The Program Counter Unit
If the ALU is the heart of the CPU, then the PCU is surely the bit that nags you to get off your ass and do things. Wait--no--maybe it's the brain. Yeah, that's probably it.
It's a bit awkward for me to try to abstract out a monolithic PCU block for testing. At least in my design, the PCU is quite closely tied in to the master state machine that controls the entire CPU. What I've ended with up here is therefore not a box labelled "PCU" that you just hook up to your ROM, RAM, ALU, etc. It's a set of pieces:
- The readable register that's used to index into the instruction ROM;
- The writable other half to that register, linked to it with pulleys in order to carry the state uphill; and
- The Next PC register, used to increment the PC, hold the new value for a jump, or dump out PC+1 to the link register.
nop
branch to immediate value
branch-and-link to immediate value
Incidentally, the two small text boxes in the screen shot, which are probably too small to read, contain the following text:
Phases of operation:
Read Next PC->PC
Increment PC
Read PC->ROM
Process instruction
Opcodes for this test [bits 15-14 only]:
0x0000: No-op
0x4000: No-op
0x8000: branch to addr in bits 13-6
0xC000: branch-and-link to addr in 13-6
0 Comments:
Post a Comment
<< Home