pixy
pixy is a simple 32-bit processor with twelve instructions.
pixy can...
here are the instructions:
-
add <rn>, <rs | value>
-
sub <rn>, <rs | value>
-
and <rn>, <rs>
-
or <rn>, <rs>
-
xor <rn>, <rs>
-
not <rn>
-
b <value>
-
mov <rn>, <rs | value>
-
load <rn>, [<rs>]
-
sto <rs | value>, [<rn>]
-
test <rn>, <rs>
- stop
arrangement:
- top left: clock in
-
middle left: data in
-
bottom left: input enable
- top right: address out
- middle right: data out
- bottom right: output enable
connecting to pixy:
- pick a device you'll be using to store programs and data, i.e. RAM.
- link data in to RAM's data output through a tristate.
- link data out to RAM's data input through a tristate.
- link address out to RAM's address input.
- link clock in to an oscillator.
- link input and output enables to the tristates.
when the clock starts, the processor will try to execute any instructions found at address 0x0000.
internals:
- the CU uses microcode stored in an EEPROM to implement the instruction set.
- information is transferred between components using a data bus which is wrapped around the circuit.
- programs can access four general purpose registers and RAM. They can also talk to any peripherals connected via memory mapping.
- a FIN signal is used to mark the end of an instruction and save clock cycles.
- conditional instructions work by triggering FIN (or not) based on ALU flags.