LogicWorks 4 runs under Windows, and is installed MBH 632 (you'll have to reboot the machines into Windows). Here's what to do:
When you are done, add your name(s) to the circuit, print it out, and hand in the printout in class on Wednesday (only one submission per group).
Once your circuit works, package it nicely into a subcircuit (see the LogicWorks manual, Chapter 6 / Using Subcircuits, pp. 149-158, in particular page 157). You will need to connect "Port In" and "Port Out" devices from the "Connect.clf" library to the inputs and outputs of your circuit, and you should remove all testing devices, such as switches and keyboards. Then, you will need to start the device editor, and draw a symbol for your circuit. Try to use the right pin spacing (2 ticks in the device editor) so that your subcircuit can easily be connected to two hex keyboards and one hex display as shown below.
Hand in a printout of the implementation of your circuit, as well as a printout of your testing configuration using the "packaged" subcircuit (which should look like the picture above). Add your name to both designs using the text tool before you print it! In case you have defined additional subcircuits, hand in printouts of those as well.
/* sort array elements a[0]..a[n-1] using selection sort */
void selSort(int a[], int n)
{
int i, j, tmp;
/* i = number of unsorted elements */
for (i=n-1; i>0; i--) {
/* find maximum among unsorted elements */
int maxpos = 0;
for (j=0; j<=i; j++) {
if (a[j] > a[maxpos])
maxpos = j;
}
/* swap max and last unsorted element */
tmp = a[maxpos];
a[maxpos] = a[i];
a[i] = tmp;
}
}
A driver to test your program is provided in
~schar/cs202/hw5/. Also, take a look at our last assembly
program from class, arrmax.s - you may even be able to reuse
part of this code.
Please document your assembly code well. In particular, please include a comment
explaining the register use. You may want to use all six registers - if you do,
don't forget to save %ebx, %esi, and %edi on the stack first.
On you submission for parts 2 and 3, please write down how much time it took you, as well as the names of any students with whom you collaborated. You cannot work as a group here - every student has to create and submit their own implementation. As usual, however, you are encouraged to go to the lab together and help each other with the particulars of using LogicWorks and assembly.
Please also submit your assembly program electronically by typing ~schar/bin/submit202 in the directory containing your assembly file.