Der Know How Computer (WDR Papiercomputer) - Paper Computers #1
Вставка
- Опубліковано 2 сер 2024
- The Know How paper computer, also called the WDR papiercomputer. Created by Wolfgang Back & Ulrich Rohde. Appeared on West German TV and in MC magazine in 1983.
This is Episode 1 of my series on paper computers. Please let me know if you have any information about any paper computers that I could look at in future episodes!
Thanks to Patrick Jackson for getting me interested in this subject.
Chris Staecker webarea: cstaecker.fairfield.edu/~cstae...
#papercomputer
Original 1983 article from MC magazine by Ulrich Rohde:
cstaecker.fairfield.edu/~cstae...
Original printable German version of the Know How Computer:
cstaecker.fairfield.edu/~cstae...
Classic footage from WDR Computer Club here:
• WDR-Computernacht 2013...
Recent Wolfgang Back footage from here:
• Papiercomputer oder Kn...
Marian Aldenhoevel's site, home of a graphical Know How Computer simulator:
marian-aldenhoevel.de/papierc...
Another simulator by Patrick Jackson, this one in python:
github.com/ProgrammingCube/5-...
My answers for the exercises:
Easy- Times Two:
1: 0 1
2: J 4
3: Stop
4: - 1
5: + 2
6: + 2
7: J 1
Fancier version:
1: 0 1
2: J 4
3: J 8
4: - 1
5: + 2
6: + 2
7: J 1
8: 0 2 #8-13 will transfer reg. 2 to reg. 1
9: J 11
10: Stop
11: - 2
12: + 1
13: J 8
Medium- Even/Odd:
1: 0 1
2: J 4
3: Stop
4: - 1
5: 0 2
6: J 9
7: + 2
8: J 1
9: - 2
10: J 1
Hard- Sum Up To:
1: 0 2
2: J 4
3: Stop
4: 0 2
5: J 7
6: J 11
7: - 2
8: + 1
9: + 3
10: J 4
11: - 3
12: 0 3
13: J 15
14: J 1
15: - 3
16: + 2
17: J D
I love this. It was a revelation to me when I was in my 20's and it dawned on me that computer programming really IS just language and that calculations are just instructions. The device itself is irrelevant.
I've been trying now to get my niece to understand this with the newer toy programmable robots that use pins like music boxes.
Hello,
May I ask you what this toy that's being programmed with pins is called? It sounds very interesting.
OMG. - I grew up in Germany and I remember this!! I actually saw this and used the Papiercmnputer as a kid. We didn’t send off for one but my dad helped me draw one. WDR is the regional broadcaster for the area in which I grew up and Computer Club was one of my favorite shows. Now I have an MS in computer science and understand what Turing completeness is. 😀
A visual aid like this would have been so helpful when I took a class teaching assembly code
My first introduction to paper computer was the TOY machine from Robert Sedgewick's Computer Science book, chapter six I think. It wasn't *meant* to be a paper computer, just a small, simple VM. I love the idea of these things. I've written the TOY machine and the CARDIAC machine in Python, and written FORTHS on top of those. I love the whole story from Charles Petzold's book CODE about building flip-flop circuits and adders, to putting that into a simple computer, to building a languages on top of that. We're so used to having iPhones, it's easy to lose sight of how far we've come.
You could even combine several of these codes to make a calculator, with data registers 1 and 2 being number inputs and reg 3 representing the function (e.g. if 0 matches then 'Add', 1 match then 'Multiply', 2 matches then 'Minus' etc) You then start the code like this.
1: O 3
2: J 4
3: J 100
4: - 3
5: O 3
6: J 8
7: J 200
8: - 3
Etc...
This then sends the computer off to different 'subroutines' depending on the initial number in reg 3. It even leaves reg 3 empty so it can be reused elsewhere in the program.
You could also reuse code in the program (eg to move the answer to a particular reg) by calling a subroutine.
I'm amazed how technical a program you can create with such simple instructions.
Even better than tearing it up in frustration: there are matches right there. Cleanse the computer with fire.
It's been 9 days that I had watched this video for the first time, and I've just realized that I hadn't thank you for this video and all the research you did for it. The last week I showed this paper computer to my math highschool students and I made them try it... some students could follow it, others couldn't but it was a very good experience... Thanks from Brazil!
FYI there is a Brazilian-made paper computer! Though a bit more complicated than this one. Google the HIPO paper computer, which will be the subject of a future video! (It's pretty similar to the Little Man Computer, which I already did a video on)
@@ChrisStaecker thanks for sharing the Hipo computer... It looks very similar to the LMC indeed...
Fascinating. Absolutely fascinating.
In 1965 we did this on a whiteboard
The author sat silently while his colleagues played the computer (ICL1900).
The author could see the crash coming and so could his pals but they gleefully flogged on until the illegal operation.
At that time we got one real test a week if we were lucky but we became pretty proficient.
Martin Gardner had a machine based on matchboxes with beads which got me turned on to this sort of human-based computing. I recall it as playing tic-tac-toe, although other things were possible with the approach. I recall having to collect some hundreds of match boxes...
Actually, a search suggests it was Donald Michie who came up with it, although it was of course Scientific American where Martin published his column.
@@bobmackay1856 Yes! it sounds like MENACE, which has been covered by StandupMaths. I thought about doing something with this, but it's doesn't quite fit in to the paper computer pantheon, and I try to stay away from topics that get covered by the youtube math heavy-hitters (standupmaths and numberphile in particular).
cool, I did multiplication in 17 lines:
01: 02
02: j11
03: stop
04: 03
05: j7
06: j1
07: -3
08: +1
09: +4
10: j4
11: -2
12: 04
13: j15
14: j4
15: -4
16: +3
17: j12
I thought I nailed it in 15, spotted an error would occur if register 1 is 0, and then I also ended up with 17
My logic was:
1 * 2 -> 3
subtract from 2
-> subtract from 1 until 0
-> add to 3
-> add to 4
3 and 4 contain copies of the original number to multiply
1 is empty
2 decreased by 1
subtract from 4 until 0
-> add to 1
copies from 4 to 1
4 is empty, 1 is its original value
repeat entire program
original value will keep moving between reg 4 and 1, 3 will keep incrementing by the original number until 2 is 0
The somewhat annotated program:
02
(if 2 != 0) J L+2
(if 2 == 0) Stop
-2
// stop program if 1 is initially 0
// multiplying by 0, so output is 0
01
(if 1 != 0) J L+2
(if 1 == 0) Stop
-1
+3
+4
01
(if 1 != 0) J L-4
(if 1 == 0)
// if we cared about number of instructions performed, here we'd check if 2 is 0
// the answer is already in register 3, there is no need to move register 4 to 1
// but here I care about lines of code
// 4 will never initially be 0 as it is the initial value of 1
// if 1 was initially 0, the program already stopped
-4
+1
04
(if 4 != 0) J L-3
(if 4 == 0) J Start
And the final program:
01: 02
02: J04
03: stop
04: -2
05: 01
06: J08
07: stop
08: -1
09: +3
10: +4
11: 01
12: J08
13: -4
14: +1
15: 04
16: J13
17: J01
Yours looks pretty similar, but it's easier to turn words into a program than to turn a program back into words, so it's difficult to compare what we did differently.
In case you or anyone is curious about the efficiency of these, I performed a few quick benchmark tests after figuring out which registers your program uses as the inputs and answer, and a way to execute these programs
For a*b, here are the number of steps for mine
a,b 0 1 2 3 4
0 2 5 5 5 5
1 2 15 28 41 54
2 2 24 46 68 90
3 2 33 64 95 126
4 2 42 82 122 162
And the number of steps for yours
a,b 0 1 2 3 4
0 2 2 2 2 2
1 9 15 21 27 33
2 16 33 50 67 84
3 23 51 79 107 135
4 30 69 108 147 186
Turns out, mine is slightly faster, and much better at multiplying by 0
After adding the steps optimisation that I considered adding in the previous comment, the code is now 27 lines long, worse at multiplying by 0, but quite a bit faster for larger numbers:
a,b 0 1 2 3 4
0 2 6 7 7 7
1 2 10 23 36 49
2 2 14 36 58 80
3 2 18 49 80 111
4 2 22 62 102 142
The faster code is:
1 02
2 J04
3 stop
4 -2
5 02
6 J15
7 01
8 J10
9 stop
10 -1
11 +3
12 01
13 J10
14 stop
15 01
16 J18
17 stop
18 -1
19 +3
20 +4
21 01
22 J18
23 -4
24 +1
25 04
26 J23
27 J04
Last comment, I swear, and I'll stop spamming your reply notifications
Turns out, the logic behind your code is _identical_ to Chris's
After finishing my multiplication and these benchmarks, I went back to the video - I paused when he said to pause and try to do subtraction and multiplication, so I didn't even know he made a solution
Chris's code is longer and takes 21 lines as opposed to 17, but I ran the benchmarks up to 99x99
And every single calculation takes the same number of steps as yours (99x99 takes 21291, if you wanted to know)
@@user-rv9vk8by5ihow are you getting 21291? when I did it I got 108010 steps for my code and 108900 steps for Chris's code.
I also wrote some longer versions that are quite a bit faster:
This one tries to copy 4 to one after copying 3 to 1 instead of moving it back first
01: 02
02: j4
03: stop
04: -2
05: 03
06: j8
07: j12
08: -3
09: +1
10: +4
11: j5
12: 02
13: j15
14: stop
15: -2
16: 04
17: j19
18: j1
19: -4
20: +1
21: +3
22: j16
benchmark:
236000 total steps for 0*0 up to 20*20
59302 steps for 99*99
I also made one that tries to add 2 at a time and is 42 lines long. I wont put the code here though because it would be too long.
I'm pretty sure it could be shorter than 42 lines but I don't really want to put in the time to find out how.
benchmark:
144800 total steps for 0*0 up to 20*20
34849 steps for 99*99
In theory you could have it try to add 3 at a time instead or any number, but you'd have diminishing returns on that.
You could also probably unroll the loops a bit for some performance increase but that isn't going to get you very far for the amount of code that's being added.
Oh also here's the benchmark for my original 17 line code:
406050 total steps for 0*0 up to 20*20
108010 steps for 99*99
And for Chris's code:
438140 total steps for 0*1 up to 20*20
108900 steps for 99*99
(Chris's code actually fails if register 3 starts at 0)
if i were Back i would totally be just as eager to talk about this thing
Tysm for this video, I was really stuck on this and had no idea on how it worked!
This is super cool. It reminds me of a unary Turing machine, so I'm not surprised it's powerful - probably Turing-complete. Next time I teach anything about TMs I'm gonna bring matchsticks.
As simple as it gets? Take that, Clive Sinclair!
By the way, WDR (West German Broadcasting) doesn't refer to West Germany, but to the West part of West Germany.
Oh boy am I excited for this shit!!
This is pretty cool. Its just Shenzhen IO but without a story and a few decades earlier. I did great at this, many hours playing Shenzhen IO seems to have actually taught me something!
This game, Shenzhen IO, can it be played without any prior programming knowledge or experience? I'm new to coding and looking for a very basic and simple game to learn the basics. Preferably one that's available on Steam. Can you suggest any? Thanks in advance.
I suggest Human Resource Machine and/or its sequel.
@@Verradonairun Yep. I've zero experience in programming too. Its not really aimed at learning programming though. Bitburner is more aimed at that, with basic javascript tools. Though bitburner can be a little tricky without help, at least for me.
@@Verradonairun Shenzhen IO and Human Resource Machine are both really nice games, but I'd advise against both if you want to learn coding. The issue is that they use low-level programming, which, long story short, 1) isn't really used that much nowadays and 2) might teach you potentially dangerous ideas like jumping and optimizing your code.
So do play them if they look fun, but maybe don't learn too much from them? (Unless you're really into low-level programming)
Sadly I can't give any good recomendations for what to play instead though. But if you follow simple tutorials (I'd recommend The Coding Train), you could easily start making your own games.
Chris, can I play Crysis on my paper computer? I heard if I wear a propeller hat, it gets overclocked?
Using Marian Aldenhoevel's interpretation of the instruction set, where '-' on a register containing zero acts like a no-operation, there's a shorter solution to Even/Odd (this won't work on Patrick Jackson's implementation, which gives an error when '-' is performed on a register containing zero):
1: 0 1
2: J 4
3: Stop
4: + 2
5: - 1
6: 0 1
7: - 2
8: - 1
9: J 1
For an initial value of zero, execution goes 1 3 stop. For an initial value that's two or greater, execution goes 1 2 4 5 6 7 8 9 (1 ...) , decrementing register 1 twice and overall leaving register 2 alone, then starting over at line 1. For an initial value of one, execution goes 1 2 4 5 6 8 9 1 3 stop. Line 7 is skipped this time. Line 8 is '- 1' when register 1 is zero; if this is a no-operation, like I stipulated at the beginning, then execution will continue, and line 1 will go to line 3 and stop the program.
*EDIT:* There's a tip to understanding, in the abstract, how this solution can be shorter. The '0' command is the conditional command in this instruction set... right? That's an easy way of thinking about the instruction set, anyway. But if '-' behaves in two different ways depending on the circumstance, then '-' is also a conditional command (just more specialized). It takes some rearranging of things, but the possibility of shortening the code by one instruction boils down to recognizing that there are *two* conditional commands, and exploiting them just right.
but y u gotta make direct eye contact with my soul
Fantastic video, thank you. Looking forward to Paper Computers #3 soon???? please?
Hopefully! I’ve been super busy the past couple months, but I’ll get to it-
Hope your wish comes true before long 😃👍🏼
Hey, you did it!
You inspired me! Still nothing on that other one, but I’m getting knowledgeable. Thanks a lot!
The 'Hard' solution you write appears to have a typo in '17: J D'. If I'm figuring your logic correctly, it should be '17: J 12'.
But then I observe that the two instruction before 'J 12' are '- 3' and '+ 2', and line 11 is '- 3'. You can remove line 15 with its '- 3', and jump to line 11 instead to get that done.
Paraphrased, "All good computers are on paper."
I don't use paper for computing; I only inconvenience electrons.
So in other words it is Turing complete.
With a gazillion memory slot, see if a number is prime or not.
Probably buy dividing all lower numbers, less than sqrt, to see if there is a remainder.
It would take awhile but doesn't seem like the code would be too big.
Ulrich Rohde is also a ham radio guy and a well-known RF engineer. He used to drive the engineering team at R. L Drake crazy. Quite a guy.
This was confusing for me, but there are actually 2 Ulrich Rohdes!
The guy in this video is the less-prominent one, who does math & computers. The other one, Ulrich L. Rohde is a RF engineer- probably that's the one you're thinking of.
I was finally convinced they are different people when I found a recent picture of the WDR Rohde here: www.cczwei.de/index.php?id=issuearchive&issueid=29
This guy is clearly the same one from the Computer Club show, but looks nothing like Dr. Rohde the RF engineer.
@@ChrisStaecker Ahah! Having (a) never done the research and having (b) only been downwind from the RF engineer's "opinions," I now stand solidly corrected. ;-) Also (c) I remember when everyone was trying to figure out microcomputers & all that. The gang at R.L. Drake was going nuts about it. Left it to others to figure out how to incorporate computer stuff into RF stuff. Which is why there are two Chinese-made SDRs on my bench, both of which are still inscrutable to me.
. . . Stay safe & sane, Chris! Onward!
This reminds me of the esoteric language BF
Did you ever hear about the "CARDIAC' computer simulator from Bell Labs from 1968?
Yes! It’s a future episode…
Would love to see an episode on the cardiac
One note: the reason I made my own simulator is because the Javascript one cant execute code that you write on your own past line 20...for some reason. It just halts, lol
Yes I noticed that bug too- drove me nuts until I figured out what was going on.
Now you can just WebAssembly 🤡
I couldn't believe it myself, but I actually got minecraft to run on one of these badboys.
Trying to program multiplication is about where I tapped out in the game 7 Billion Humans (it is basically ein know how computer)
Is the next one going to be the Cardiac?
en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_Computation
No spoilers! (but yes this is on my list) VERY hard to get an original one, unfortunately.
@@ChrisStaecker I think I have one and I can send it to you. Just sent you an email!
@@ChrisStaecker I have seen them on sale on the internet, the French version also.
Reminds me of the Bell Labs CARDIAC
Yes I have one- it’ll be in a future video.
Can you get a name that's more Gernan than Wolfgang Bach?
I like to do my own computation
I would like to buy an original instructo paper computer. Is there any source?
I am also open for exchanging with another paper computer: Cardiac or and it's french version. called Ordinapoche
Please hello.
I don't have an original instructo paper computer- I have never even seen one in person or on sale anywhere. I know Mr Matt has a few of them, but I don't think he's selling! I've been watching on ebay for years, but never seen one.
@@ChrisStaecker I need it for a science fair we are conducting here in India.
@@gpuguy Sounds fun! The best I can offer is my printable version here: cstaecker.fairfield.edu/~cstaecker/machines/instructo.html
It is basically identical to the original one.
@@ChrisStaecker So nice of Mr Chris! :-)
But can it run Crysis?
Time to program a paper sine function
Actually Rohde's original article (link in description) briefly discusses how you could compute the exponential function exp(x) using its Taylor series. Sine and cosine would be about the same difficulty (ie way too difficult to actually do, but in theory possible)
Have you been able to code this?
@@RetroNerdstalgia Never tried (and unlikely I ever will). If I really wanted to do it, I probably wouldn't do it by hand. Sounds easier to write a script to translate basic arithmetical expressions into papercomputer code.
Multiplication in 13 lines: A=B*C
(the first line is line zero; and alphabetical registers; B & C must be greater than zero)
dec B
inc D
inc A
isz B
jmp 0
jmp 8
dec D
inc B
isz D
jmp 6
dec C
isz C
jmp 3
This is disturbingly very similar to Brainf\/(k.
Yes! That language is famously hard to use because of its small instruction set, but the Know How Computer's instruction set is even smaller. Very similar though.
Shit i did the first problem in a different way, same number of lines though.
1) 0 1
2) - 1
3) 0 1
4) J 2
5) Stop
problem 2: before answer
1) 0 2
2) + 1
3) - 2
4) 0 2
5) J 2
repeat for box 3 and 4 then stop.
7:20 Challenge accepted!
1 02
2 J4
3 J7
4 -2
5 +1
6 J1
7 03
8 J10
9 J13
10 -3
11 +1
12 J7
13 stop
The spiteful helen endogenously owe because rowboat suddenly scribble at a lumpy equinox. guiltless, handsomely jail