Re: MultiBit AND gate
Posted by
cadet1620 on
Mar 19, 2012; 8:50pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/MultiBit-AND-gate-tp3839418p3840325.html
The skeleton file for the And16 says:
// This file is part of the materials accompanying the book
// "The Elements of Computing Systems" by Nisan and Schocken,
// MIT Press. Book site: www.idc.ac.il/tecs
// File name: projects/01/And16.hdl
/**
* 16-bit and gate. For i=0..15 out[i] = a[i] and b[i]
*/
CHIP And16 {
IN a[16], b[16];
OUT out[16];
This syntax means that
a,
b and
out are 16 wire buses. Read appendix A.5.3 to learn more about buses.
And16 is nothing more than a box that has 16 And gates in it:
out wire 0 =
a wire 0 AND
b wire 0, etc.
--Mark