Just starting out ? ...no source pin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Just starting out ? ...no source pin

mailbox@pmdennis.com
Here's my implementation of OR, yielding the following complaint from Hardware Emulator:  \path\OR.hdl, Line 20, in has no source pin


// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Or.hdl

 /**
 * Or gate:
 * out = 1 if (a == 1 or b == 1)
 *       0 otherwise
 */

CHIP Or {
    IN a, b;
    OUT out;

    PARTS:
    Nand(a = in, b = in, out = w);
        Not(in = w, out = out);
}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Just starting out ? ...no source pin

cadet1620
Administrator
mailbox@pmdennis.com wrote
Here's my implementation of OR, yielding the following complaint from Hardware Emulator:  \path\OR.hdl, Line 20, in has no source pin
...
CHIP Or {
    IN a, b;
    OUT out;

    PARTS:
    Nand(a = in, b = in, out = w);
    Not(in = w, out = out);
}
It says line 20 because it detected the error at the end of the file.
Your Nand vate is trying to connect a wire named 'in' to its inputs named 'a' and 'b', but there is no wire named 'in' connected to any part output, nor specified on the IN command.

If you haven't read it yet, check out The Hardware Construction Survival Kit. In particular read the "What is the meaning of a=a?" section.

--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Just starting out ? ...no source pin

mailbox@pmdennis.com
Thanks for the prompt response.  That - and a few tweaks of my logic - did the job.
Loading...