热度 20
2012-5-25 13:06
2162 次阅读|
0 个评论
According to the Phrase Finder , the concept of tickling pink is of enjoyment great enough to make the recipient glow with pleasure, which pretty much describes my current state of being. I just received the most amazing email... but before we go there, in order to set the scene, I need to explain that a couple of years ago my chum Alvin and I wrote a book called How Computers Do Math . (May I be so bold as to note that this little rascal, which has 4.9 stars out of 5.0 on Amazon, would make an ideal gift for anyone who wants to know more about how computers perform their magic.) Accompanying the book is a virtual 8bit microprocessor. The interface to this virtual machine is a calculator front panel as illustrated below (the reason some of the buttons are blank is that you can configure them to have whatever annotations you wish). When you first power-up this little scamp, whose official name is the DIY Calculator (DIY stands for "Do-It-Yourself") nothing happens... The idea is that the book guides the reader via a suite of step-by-step labs to create a program in assembly language that makes our virtual microprocessor and calculator front panel function as a simple four-function calculator. But the possibilities are limitless – someone has already created a BASIC interpreter (in our assembly language, of course), and I have plans to create a simple C Compiler (again in our assembly language)... one day. OK, one more thing before we proceed to the reason for this column is that – as part of the DIY Calculator project – we also created something called The Official DIY Calculator Data Book (you can access both the DIY Calculator software and this Data Book for FREE from the Downloads page of our www.DIYCalculator.com website). This data book was modeled on the old microprocessor data books of the late 1970s. It basically tells you everything you need to know to build your own 8bit microprocessor from the ground up. All of which leads us to the following message, which I just received from John R. Wind: Hello Mr. Maxfield. If you don't mind, I thought I would tell you about a project of mine that implements your "DIY Calculator" in a digital logic simulation program called Logisim (Website – http://ozark.hendrix.edu/~burch/logisim/ ). I am an Electrical Engineer from Grand Rapids, Michigan, and I found Logisim on the internet one night. It is a nice little cross-platform program that I can carry about on a thumb drive and work on projects when I am bored. Now all I needed was a project. There are many digital devices built into Logisim, but one thing lacking was a CPU. After searching around for a premade CPU, I found that a lot of college-level computer classes ask students build a CPU in Logisim as classwork. So I thought that sounded like fun. In looking for information about CPU design, I came across your "DIY Calculator" website. The descriptions in the "Official DIY Calculator Data Book" were just what I needed to get started. Much of the design is a straight forward implementation of your descriptions. Coming up with the Instruction Decoding and Sequencing control logic myself was enough of a challenge to make it interesting. Logisim is very hierarchical and lets you define sub-circuits that you can assemble to make larger constructs. This feature was used to greatly help in organizing the design. Now that I have your virtual CPU built out of digital logic components, I can use it as a sub-circuit to build larger projects with. As an example, I have built a keypad and display that faithfully emulate your "DIY Calculator" and are connected to your virtual CPU along with some memory in the RAM and ROM configuration described in your book. This setup is serving as my "test bed" because it is 100% compatible with all of the programs from your book "How Computers Do Math". Currently, I am trying them out to see if any glaring bugs in my design pop up. Depending upon the computer running Logisim, the virtual CPU is no speed demon. The fun for me is in getting the assembly code to work, not in using the result. The DIY Calculator running in Logisim Logisim is very graphically oriented, and it is very educational to look into the design of the CPU and watch how the program is being executed as you step through it. When satisfied, I intend to make my design available to others on the Internet. I thought you might appreciate this because, in a sense, you have provided all of the documentation. If asked for information on the little CPU, I will just refer others to your book. :-) This was all just a warm up. Back when I was a high school student, I built a microcomputer out of a kit that used the RCA 1802 Cosmac Elf microprocessor. I think next that I may relive my youth by designing an 1802 CPU in Logisim and re-building (in a virtual fashion) the microcomputer I once had. There is something satisfying about going myself one better by having to build the CPU itself first. Cheers, John R. Wind PS Just FYI, the display in the image above is saying "Hello World" because it is running that program from your book :-) Wow! Color me impressed. I immediately emailed John back and we bounced a few messages back and forth. John very kindly provided a copy of the Logisim version of the DIY Calculator for anyone to play with if they want ( Click Here to download it in the form of a ZIP file – of course you will also need to download Logisim itself from the website noted in John's message). But wait, there's more, because John kindly said I could share his email ( jrwind@comcast.net ) so that anyone who does play with his Logisim version of the DIY Calculator can contact him with comments and suggestions. The end result is that, as I noted in the title of this column, I am "Tickled Pink". I cannot even begin to describe the countless hours I spent creating the diagrams and text in How Computers Do Math and in The Official DIY Calculator Data Book , so knowing that someone has used this work to the level that John has it very, very gratifying. I think I will have a warm glow for a long time to come...