PageRenderTime 222ms CodeModel.GetById 80ms app.highlight 1ms RepoModel.GetById 140ms app.codeStats 0ms

/1/And16.hdl

http://github.com/happy4crazy/elements_of_computing_systems
Unknown | 32 lines | 28 code | 4 blank | 0 comment | 0 complexity | 4b371b17435a551d05b95cc03da85062 MD5 | raw file
 1// This file is part of the materials accompanying the book 
 2// "The Elements of Computing Systems" by Nisan and Schocken, 
 3// MIT Press. Book site: www.idc.ac.il/tecs
 4// File name: projects/01/And16.hdl
 5
 6/**
 7 * 16-bit and gate.  For i=0..15 out[i] = a[i] and b[i]
 8 */
 9
10CHIP And16 {
11
12    IN  a[16], b[16];
13    OUT out[16];
14
15    PARTS:
16    And(a=a[0], b=b[0], out=out[0]);
17    And(a=a[1], b=b[1], out=out[1]);
18    And(a=a[2], b=b[2], out=out[2]);
19    And(a=a[3], b=b[3], out=out[3]);
20    And(a=a[4], b=b[4], out=out[4]);
21    And(a=a[5], b=b[5], out=out[5]);
22    And(a=a[6], b=b[6], out=out[6]);
23    And(a=a[7], b=b[7], out=out[7]);
24    And(a=a[8], b=b[8], out=out[8]);
25    And(a=a[9], b=b[9], out=out[9]);
26    And(a=a[10], b=b[10], out=out[10]);
27    And(a=a[11], b=b[11], out=out[11]);
28    And(a=a[12], b=b[12], out=out[12]);
29    And(a=a[13], b=b[13], out=out[13]);
30    And(a=a[14], b=b[14], out=out[14]);
31    And(a=a[15], b=b[15], out=out[15]);
32}