University of Minnesota
Machine Architecture and Organization (sec 010)

CSci 2021 Lab 0x4

In today's lab we'll work on puzzle style questions, which require to implement functions using as few simple arithmetic operators as possible.

  1. (Lab Setup)

    You can get the handout using the command cp /web/classes/Spring-2020/csci2021/labs/0x4/datalab-handout.tar , or downloaded from here . Once you have your handout downloaded to one of the cselabs machine, eg:, unzip the handout using the comand tar -xvf datalab-handout.tar . Use the command, make to compile the code. Verify that an executable btest is created.

  2. ( Solving the Puzzles )

    There are five puzzles that need to be solved, namely, negate, bitAnd, tmax, tmin, replaceByte. In these puzzles, you need to implement the said operations using as few operators as possible. These functions can be updated in the file bits.c . Once you have updated bits.c with your implementation, compile the code using make and run the executable btest. Your score will be output on the terminal, based on correctness. The legality of your solution can be tested using the program dlc. The detailed instructions regarding the implementation of these functions, and testing, can be found in README.