Published Jan 27th, 2014, 1/27/14 6:16 am
- 1,761 views, 1 today
- 47 downloads, 0 today
34
Compact and fast 8 bit program counter with branching capabilities.
Adds/Substracts the input to/from the output value stored in the latch (includes an overflow flag), respectively sets the input value.
In normal operation, the output value (program address) is incremented by 1, 2 etc. each add/substract-clock pulse, according to your addressing scheme/instruction size.
To perform a relative jump (program counter +- offset), change the input to the desired offset and choose wether to add or substract.
A reset or direct jump can be performed by setting the input to zero respectively the address and a pulse on the set-clock line.
Yellow: add/substract-clock input
Brown: set-clock input
Purple: add (off) / substract (on) input
Red: output value (orange indicates LSB)
Green: overflow flag
Adds/Substracts the input to/from the output value stored in the latch (includes an overflow flag), respectively sets the input value.
In normal operation, the output value (program address) is incremented by 1, 2 etc. each add/substract-clock pulse, according to your addressing scheme/instruction size.
To perform a relative jump (program counter +- offset), change the input to the desired offset and choose wether to add or substract.
A reset or direct jump can be performed by setting the input to zero respectively the address and a pulse on the set-clock line.
Additional Notes
Blue: value input (light blue indicates LSB)Yellow: add/substract-clock input
Brown: set-clock input
Purple: add (off) / substract (on) input
Red: output value (orange indicates LSB)
Green: overflow flag
Credit | Instant carry adder: XxDOTxX, 1,5 Tick XOR: CMOSprinkles |
Progress | 100% complete |
Tags |
2717471
2
Create an account or sign in to comment.
i was away from here for over a year, post something and a few hours later, there you are :D awesome
Such a device is used for example as one of the main parts of a cpu (for which i made it), the program counter, a special register holding the address of the currently executed instruction. Each clockcycle, this address is incremented, pointing to the following instruction to execute.
With the functions add, substract and set you can perform most types of jumps inside a program (to a sub routine, loops, conditional branching, ...).
Of course this can be used for other things, for example, if you hook up a clock circuit and a binary comparator (you can find one in my projects), you have a programmable timing circuit.