BarkingOven | 12 years ago | on: Ask HN: did you ever implement a toy processor?
BarkingOven's comments
BarkingOven | 12 years ago | on: Why does the alarm clock snooze button give you nine extra minutes, not ten?
BarkingOven | 12 years ago | on: Why does the alarm clock snooze button give you nine extra minutes, not ten?
Let's say it's 6:00, and you hit the snooze button. Save the current value of the minute minus 1, into a comparitor, Trigger the alarm when the comparitor goes off automatically.
If you save the current value into the comparitor, the alarm triggers immediately. Now you need to add delay logic. Just use current minus 1, since it's only a few half-adders.
You can't use the high order minute digit because then your snooze length will depend on your current low order minute digit. Any logic to compensate starts adding a multiple of the number of components required.
BarkingOven | 12 years ago | on: 0 to 60 in One Second: Fusing WebGL, CSS 3D and HTML
Little badge popped up on the bottom of the screen: Achievement Unlocked - All Glory to the Hypnotoad
The event queue even handled propagation delay.
I made it so that if a tristate bus was held to both high and low at the same time, then an exception would be thrown that told you you "let the blue smoke out" and ended the program.
Binary instructions were read from a static string buffer which were then interpreted by the logic to implement the functions of the cpu and alu.
In the end, I discovered that the cpu logic block that we had been told to emulate was missing a one clock cycle delay buffer and should not have functioned properly if anyone else implemented it accurately.
Wish I still had the code for that, it was super fun to make.