Shall I write 16 lines of every bit to implement Not16?

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

Shall I write 16 lines of every bit to implement Not16?

woodylcy
 the Not16 chip's port is like this
 IN  in[16];
 OUT out[16];

I've implemented Not chip. so is there any syntax like  for(; ;) in C programming language?
Shall I write 16 lines of every bit?

 In addition, I have another question:
 When I've loaded the chip into Hardware Simulator, Why I can't modify the chip's .hdl file and save it?
 I just exit the Simulator, modify the .hdl file, then save it, then open Simulator.. I find it's quite not sensible.


thanks a lot.

Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

cadet1620
Administrator
There is no way to automatically generate the 16 Nots that you need for Not16. I suggest writing one line with no numbers in the []s and copying it 16 times. Then you can quickly run down the columns of []s inserting the numbers.

I also have the problem that the TECS tools hold files open so that my editor can't write to them. It's quite annoying.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

woodylcy

thanks a lot for your reply.
    I got your idea.^_^
Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

milythael
In reply to this post by cadet1620
As a software developer / *nix user, I used bash for loops to generate my lines of code then cut and pasted them into my hdl.
Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

TSomKes
In reply to this post by woodylcy
It is unfortunate that the .hdl file can't be edited directly in the Hardware Simulator, but it's not necessary to exit & re-open the Simulator to pick up the .hdl changes, assuming you're using one of the provided .tst scripts to test.

Use the "Reset" button (adjacent to the "Stop" button) to move script execution back to its beginning.  Next time the script is run, it will load the .hdl file (which is usually the first line in the test script).  The script should be run against your most recently saved changes.
Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

Alpal
In reply to this post by woodylcy
There is a work around, potentially saving you a lot of effort

I used a bash script to prepare my hdl file.  If you are not using UNIX you may have to use a different script.  Prepare the script using:
       chmod u+x Not16.hdl
and run it using
       ./bashscriptname > Not16.hdl

echo "/** A Not16 gate */"
echo "CHIP Not16 {"
echo "  IN in[16];"
echo "  OUT out[16];"
echo " "
echo "  PARTS:"

for i in {0..15}
do
        echo "          Not(in=in[$i], out=out[$i]);"
done

echo "}"
Reply | Threaded
Open this post in threaded view
|

Re: Shall I write 16 lines of every bit to implement Not16?

ajamil
In reply to this post by woodylcy
Hi Woody,
If I am good at apprehending what you meant, you were running Hard_Sim and then go back to notepad and edit your .hdl script and come back to run it in Hard_Sim and it won't update it so you were exiting the Hard_Sim. excuse me if this is not right, but if it is then I had exactly the same issue and first I also did exactly like you but then I figured it out. Its just that you go one step up the folder 'project list' in this case and then come back and the file would have been updated.
I hope that would help those starting course in this session.
regards