*******************************************
c2c compiler (Last update: Jan 30th, 1:00)
*******************************************
There is a new version of "c2c" in the HOME213/L1 directory. The old "c2c" compiler does not count the pre-increment and pre-decrement operator, this version should have fixed the problem.
***************
ATTENTION
***************
PLEASE FIX THE FOLLOWING IN YOUR ASSIGNMENT:
=================================================================
Please ignore my previous posting regarding the following functions:
All restrictions are as stated in the handout.
The following rules are used to evaluate bits.c:
To help you count the number of operators and control flow constructs in bits.c, you are also given c2c in the lab directory HOME213/L1.
c2c gives a cumulative count on the number of operators and control flow constructs for each function. To run c2c, enter the following command:
cpp bits.c | c2c
cpp is the C preprocessor. c2c also prints out all illegal operators.
============
e_perm table
============
In cry.ps, the description of expand_permutation says that "for each block of 4 input bits, the first and fourth bits appear twice in the output while the two middle bits appear once." If I understand that correctly, then I think there may be a mistake in the declaration of the e_perm array in bits.c. I've copied e_perm below, and the part that I'm confused about is the second row, which reads in part "8,9,9,9."
int e_perm[48] = {32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1};
Why is 9 repeated three times instead of twice? Should it be "8,9,8,9" or did I misunderstand the description of expand_permutation?
It is a mistake in the e_perm table. However do NOT fix the table, use the values in the table for your expand_permutation function.
=======================================================
In and_n or_n and not_n, the last "arg3" bits refer to the least significant arg3 bits.
=======================================================
You are not allowed to change the order in which the functions are defined.
=======================================================
There are two version of bits.c out there, with different function order. Both function order will be accepted.
=======================================================
Recursive solutions are allowed.
=======================================================
Assignment operator "=" is allowed.
=======================================================
You could change "static state" to "static int state" if you choose to. It should not effect the output of the program.
Back to CS213 home page.