I tried to build Incrementer chip with the help of 16-bit Adder chip which was build and tested successfully.
What I don't understand is which value should be put for "b" pin of Adder chip. I tried with "true" keyword but the Hardware simulator reported an error while running a testing script. Input value was 16-bit value for 0. And Incrementer out pin was again 0.
Think of the symbols true and false being wires... that are one 'bit' wide and on/off.
As for your implementation, note that your hdl is using And16, not Add16 as you describe. Assuming the use of Add16, you'd have to individually wire false and true to each of the 16 connections of b.
I don't know if this would make any difference to your implementation (I don't know if you're counting chips inside chips)) but just lately reading appendix A I realized that in HDL you can directly set an input pin of a chip to any value you choose.
You can actually implement the Inc16 chip with a single Add16 chip. If you carefully read Appendix A, mainly the section on buses, it will tell you that you can set the values of the individual pins on a bus in the chip call by indexing the pins, you can also use the "n..x" notation to specify a range of pins to set to individual values. So you could set the value of bus b for the Add16 chip to 1 using the following:
This would save you considerable typing, also since its not immediately obvious to those who just read the text really quick and assume the "n..x" notation is just used in the text and would not work in HDL. It does work and is very useful.
i just wanted to know whether the following code for the Inc16 chip works in the Hardware Simulator(coz its not working for me and i just wanted to clarify it again)...
i really wanted to know why it does not work though its mentioned in Appendix A that each pin in the bus can be assigned individual values....this reduces a lot of writing work i know and just can be used to get the idea of using an Add16 chip for the Inc16 chip....please do help me on this!!!
It looks good except for a couple of small things I noticed.
You set a to take itself as input rather than the actual input to the chip.
You use a round bracket in one place where you need to use a square one.
Nice, shmcinto! The book says, "An n-bit incrementer can be implemented trivially from an n-bit adder." So I was thinking there had to be a way to set individual pin values. Since it all translates to boolean logic, setting pins to true or false makes complete sense to me.