|
|
This post was updated on .
okay I know that one next step post is already there on the forum but mine is a bit different.
I want to know how to make the things we made by simulation real.
Not just how but also how(pun intended)? That is to say how does it work in electrical engineering from basics.
|
|
While it is certainly possible to physically build what we have simulated and made in software, there is a lot of magic behind the scenes that the VMemulator does that would have to be done in hardware to replicate a working system...in this case the hack computer.
Additionally, you would have to decide how in depth you would like to go in recreating this project.
IE. recreating everything from basics would involve using an incredible amount of chips. You would be better off getting a single 16k ram chip for use since abstracting hack's 32k of memory back to DFF's you would have to literally wire up thousands of DFF's to recreate the memory section of the hack computer. Then you would have to prototye a interface that would allow you to flash/program that memory with your programs from your computer (part of the magic i was referring to).
You would have to deal with hack's keyboard and screen. This is just convieniently provided with TECS.
You would have to design an interface that would scan the keyboard and write its data to the proper memory locations, likewise for the screen...it would have to read the memory location that corresponds to the screen. You would need to also devise some sort of bus arbitration such that you don't try to access the data or address busses when they are in use by another peripheral (screen, keyboard, etc..)
I don't want to discourage you from taking on a project such as this, but there is definitely more than meets the eye when it comes to understanding the hack computer in TECS conceptually vs a working hardware version of it physically in front of you.
|
|
That seems a lot of work there
Can you just give me some references which I can use to make my work a bit simpler
Thank you
|
|
I'm planning to do the "next step" as well. Here is a brief outline on how I plan to do it. Maybe this will help you.
[hardware chapters]
-> using VHDL to create the ALU, CPU, then computer thing
-> using Xilinx to simulate and test it and eventually synthesize it and load it into an FPGA
-> If you have the cash, get a board that has more than enough block RAM. (or else you'd have to figure out how to use external memory)
-> verify functionality using the supplied HACK code for the pong game that
[software]
-> chapter 6 and up focused on how to get the HLL into machine code so there isn't much additional work to do here. You just need to be confident enough that your stuff will be able to work all the way down. from Jack to OS to compiler to vm translator to assembler to binary.
-> need to reduce code bloat like crazy because 32k for a rom is very little.....
|
|
Hey virote328!
Your outline got me very exited to do something similar (I've secretly nurtured a fantasy of doing something similar for a long time), but I don't really have the knowledge. I've been reading a bit about FPGA's, but I feel kinda lost. Do you have some tips on how one would go about implementing something like that, or where I could read about it?
|
|
Hi maestron
Fpga development is rare and as a result documentation is scarce. Are you a student? If so you could order a spartan 6 fpga from digilent.com for about $100 maybe a little more
You will need to down load a program called Xilinx.
If you have cash to spare," vhdl programming by example" is a good book.
This too
So you got the code and want to put it on the board. Create a ucf file to connect the ports of your vhdl entity to the pins of the actual board. Check documentation for that.
Generate a bit file and load it into the fpga.
Digilent should have a sample project with code and a ucf file. It can show you how it works.
Feel free to ask more questions.
On Sat, Jun 22, 2013 at 2:02 PM, maestron [via Nand2Tetris Questions and Answers Forum] <[hidden email]> wrote:
Hey virote328!
Your outline got me very exited to do something similar (I've secretly nurtured a fantasy of doing something similar for a long time), but I don't really have the knowledge. I've been reading a bit about FPGA's, but I feel kinda lost. Do you have some tips on how one would go about implementing something like that, or where I could read about it?
|
|
Thanks a lot for the response! I am a student, but not in the US. Can I still get the discounted price? Also there seem to be multiple Spartan-6 boards, is this the one you mean?
It seems like I could connect that to a keyboard and monitor? How would I interface with these? Is it similar to what you do in nand2tetris?
|
|
That looks like the board I have and use. All they ask for is an email of your teacher. Give them one and you should get the discount. I'm sure your teacher would love to help you out
An yes, you can attach a keyboard and a monitor. But to make it work is not an easy path. If you are up to the challenge I can link you to a tutorial on how to interface with monitor
On Sat, Jun 22, 2013 at 3:03 PM, maestron [via Nand2Tetris Questions and Answers Forum] <[hidden email]> wrote:
I am a student, but not in the US. Can I still get the discounted price? Also there seem to be multiple Spartan-6 boards, is this the one you mean?
It seems like I could connect that to a keyboard and monitor? How would I interface with these? Is it similar to what you do in nand2tetris?
|
|
Sounds great, I'll get a teacher right on that!
I'm definitely up for a challenge, link me up! Also, I started reading the hamsterworks guide, and it looks great so far. I'll look into the book as well.
One other thing. If there's no ROM, how would I get a hack program to run on the computer inside the FPGA? Can you control the starting content of the RAM somehow?
|
|
http://www.mikekohn.net/micro/fpga_vga.php
It is a different device, but the VHDL code works and looks super simple. You will need to figure out the correct UCF file.
As for theory, Look for the " nexus 3 Reference Manual" in the same place you can buy the spartan 6 board. there is a chapter about the VGA.
Good luck! On Jun 22, 2013, at 3:36 PM, maestron [via Nand2Tetris Questions and Answers Forum] wrote:
Sounds great, I'll get a teacher right on that!
I'm definitely up for a challenge, link me up! Also, I started reading the hamsterworks guide, and it looks great so far. I'll look into the book as well
|
|
Thanks a lot for all the help!
|
|
If you think you understand vhdl enough, try doing these labs. Here is the first one
http://www.cs.ucr.edu/~jtarango/cs122a_lab1.html On Sat, Jun 22, 2013 at 4:33 PM, maestron [via Nand2Tetris Questions and Answers Forum] <[hidden email]> wrote:
Thanks a lot for all the help!
|
|