+/TECS

git clone https://git.julia.blue/+/TECS

P1n3appl3Remove headers5e97a3a

v1.0
846 B23 linesraw
1/**
2 * Memory of 8 registers, each 16 bit-wide. Out holds the value
3 * stored at the memory location specified by address. If load==1, then 
4 * the in value is loaded into the memory location specified by address 
5 * (the loaded value will be emitted to out from the next time step onward).
6 */
7
8CHIP RAM8 {
9    IN in[16], load, address[3];
10    OUT out[16];
11
12    PARTS:
13    DMux8Way(in=load,sel=address,a=w1,b=w2,c=w3,d=w4,e=w5,f=w6,g=w7,h=w8);
14    Register(in=in,load=w1,out=w9);
15    Register(in=in,load=w2,out=w10);
16    Register(in=in,load=w3,out=w11);
17    Register(in=in,load=w4,out=w12);
18    Register(in=in,load=w5,out=w13);
19    Register(in=in,load=w6,out=w14);
20    Register(in=in,load=w7,out=w15);
21    Register(in=in,load=w8,out=w16);
22    Mux8Way16(a=w9,b=w10,c=w11,d=w12,e=w13,f=w14,g=w15,h=w16,sel=address,out=out);
23}