CIS 351 |
Introduction to JLS |
Fall 2021 |
The objective for this lab is to
You are encouraged to work in teams of two on this assignment.
Begin by following this GitHub Classroom link to create the GitHub repository for this assignment. You will be asked to select or create a team name. The team you create is valid for this assignment only. You may switch teammates between assignments if you like.
All the necessary code is contained in a single .jar
file.
JLS.jar
in /home/kurmasz/public/bin
. The easiest way to run JLS
in EOS/Arch is to put this directory in your path. (For most of you, the best way to do this is to add the
line export PATH=$PATH:/home/kurmasz/public/bin
to the
end of your .bashrc
.) There is a script named jls
in this directory that sets up the java
classpath and launches JLS. This directory also contains other scripts that will make your life in this course much
easier. If you object to adding this directory to your path, you can also launch JLS with this
command: java -jar /home/kurmasz/public/bin/JLS.jar
/JLS.jar
.JLS
on your own machine, you can download the jar
file
here. (Please do not email Prof. Poplawski for a copy of JLS
.)This video demonstrates how to use wires, subcircuits, and parallel gates in JLS.
Use JLS to build an circuit that adds two 16-bit unsigned integers.
You can use any design you like (ripple-carry, carry-lookahead, etc.).
A ripple-carry adder is the simplest; but, building a faster, more complex adder will give you a head start on Project 1.
(To be specific, to get full credit on Project 1, you ned an adder that is faster than 225
.)
The starter code contains a .jls
file named "UnsignedAdder_16bit
". Your solution must go in this file (the auto-grader won't find it otherwise).
Also, you must not change the names of the inputs and outputs. (Again, doing so will break the autograder.)
To keep the design manageable, you may want to use one or more sub-circuits (e.g., connect four 4-bit adders, or two 8-bit adders). If you do use sub-circuits, notice that you can unbundle buses into arbitrary groups. For example, you can take a 16-bit bus and split it into 0-3, 4-7, 8-11, and 12-15. In the "Create unbundler" dialog, select "Group bits" instead of "Single bits". (See the "Sign Extender" tutorial built into JLS.)
You may not use the built-in JLS adder. You must create your own full adder. Remember, you can save your full adder as a separate file and import it (using "File -> Import").
DLUnit
allows you to write and execute JUnit tests for your circuits.
To run DLUnit
/home/kurmasz/public/bin
is in your PATH
dlunit_compile IsPrimeTest.java
DLUnit
: dlunit isPrime.jls IsPrimeTest.class
.
javac -cp DLUnit.jar IsPrimeTest.java
java -jar DLUnit.jar isPrime.jls IsPrimeTest.class
.Test your circuit using SampleUnsigned16BitAdderTest.java
.
If the test script doesn't work without modification, then you either
named your circuit, inputs, or outputs incorrectly. Note, however, that SampleUnsigned16BitAdderTest
will not completely test
your circuit. Add as many tests as necessary to be confident your
circuit works.
Also, you can create and import subcircuits (analogous to writing a function in code). Go to "File -> Import" to import a saved subcircuit.
When your circuits passes the autograder tests:
jls
files that includes
the names of all team members.jls
files, and any additional test files
you used. Include [Grade Me]
in the commit message.
Updated Thursday, 16 September 2021, 10:33 PM