Memory.hdl

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory.hdl

glassesfame
CHIP Memory {
    IN in[16], load, address[15];
    OUT out[16];

    PARTS:
    DMux (in=load, sel=address[14], a=ramload, b=device);
    DMux (in=device, sel=address[13], a=screenload, b=keyload);
    RAM16K (in=in, load=ramload, address=address[0…13], out=ram);
    Screen (in=in, load=screenload, address=address[0…12], out=screen);
    Keyboard (out=keyboard);
    Mux16 (a=ram, b=screen, sel=screenload, out=temp);
    Mux16 (a=temp, b=keyboard, sel=keyload, out=out);
}

This is my Memory Chip and I can't see anything wrong with it. However, the Hardware Stimulator is refusing to run it and when I submit it into the grader output, I am told that I have an 'unspecified sub-bus'. I really need some help - the hardware stimulator also refuses to run anything with RAM16K and Screen, is it because I've made some mistake in the code?

For example, this will run:
CHIP copy {

    IN in[16], load, address[15];
    OUT out[16];

    PARTS:
    DMux (in=load, sel=address[14], a=ramload, b=device);
    DMux (in=device, sel=address[13], a=screenload, b=keyload);
    Keyboard (out=data);
    Mux16 (a=in, b=in, sel=screenload, out=temp);
    Mux16 (a=temp, b=data, sel=keyload, out=out);
}

but once I add in one line of Screen (in=in, load=load, address=address[0...12], out=unknown);, it will stop working. Example:

CHIP copy {

    IN in[16], load, address[15];
    OUT out[16];

    PARTS:
    DMux (in=load, sel=address[14], a=ramload, b=device);
    DMux (in=device, sel=address[13], a=screenload, b=keyload);
    Keyboard (out=data11);
    Screen (in=in, load=screenload, address=address[0…12], out=data10);
    Mux16 (a=in, b=data10, sel=screenload, out=temp);
    Mux16 (a=temp, b=data11, sel=keyload, out=out);
}

Please explain?
Reply | Threaded
Open this post in threaded view
|

Re: Memory.hdl

ivant
glassesfame wrote
but once I add in one line of Screen (in=in, load=load, address=address[0...12], out=unknown);, it will stop working.
The syntax for subbus is with two dots, not three: address[0..12]. The same problem is present in your other post.

Please make sure to remove the code from both posts, if and when your problem is fixed.