(Note that this repo was designed for interactive, 1:1 teaching -- for a specific student -- and may not stand well on its own)
Are you having trouble with:
- Central Processing Units?
- Graphics Processing Units?
- Tensor Processing Units??
Who needs 'em?! Use your buddy Robert's processing unit instead.
Those other processing units are hard. They have like, features, and performance guarantees, all kinds of stuff. You don't need all that. Your buddy Robert's processing unit is easy peasy. It only has a few instructions, and none of them does anything crazy:
add: Adds two numbers together. Easy!copy: Copies stuff from one register to another. Easy!halt: Turns the computer off. No problem!put: Puts a number into a register. Easy!jump: Skip ahead a few instructions. Or back. Simple!mul: Multiple two numbers. Third grade stuff!noop: Literally DO NOTHING. Like falling off a log.pop: Take a value off the stack.push: Place a value on the stack.put: Write a value to a register. Couldn't be simpler.read: Pull some data from memorysub: Subtract two numbers.write: Put some data into memory
- Run
sudo make installto installrpuand its man page. - Run
man rputo read the man page
(Alternatively, cargo run -- examples/blah and man ./rpu.6
will work just fine)
- Run
rpu examples/print_5.sto see how to write the number "5" to LCD0. - Run
rpu examples/add_5_6.sto see how to add 5 + 7 and write "12" to LCD0. - Run
rpu examples/countdown.sto see how to make LCD0 display the numbers 5,4,3,2,1 in order. - Run
rpu examples/fibonacci.sto see how to compute the fibonacci sequence, showing the latest number on LCD0, and the previous number on LCD1.