Week 07 Laboratory Exercises

Objectives

  • to practice using bitwise memory
  • to practice manipulating dynamic memory
  • to explore arbitrary precision integer arithmetic

Preparation

Before the lab you should re-read the relevant lecture slides and their accompanying examples.

Getting Started

Set up for the lab by creating a new directory called lab07 and changing to this directory.
mkdir lab07
cd lab07

There are some provided files for this lab which you can fetch with this command:

1521 fetch lab07

If you're not working at CSE, you can download the provided files as a zip file or a tar file.

Exercise — individual:
Create An addi Instruction

INTERNAL ERROR MISSING SOURCE FILE: activities/addi/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest addi 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_addi addi.c

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Exercise — individual:
Convert from big- to little-endian in MIPS

INTERNAL ERROR MISSING SOURCE FILE: activities/mips_networking/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest mips_networking 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_mips_networking mips_networking.s

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Exercise — individual:
Extract The Components of a Float

INTERNAL ERROR MISSING SOURCE FILE: activities/float_bits/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest float_bits 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_float_bits float_bits.c

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Exercise — individual:
Multiply A Float by 2048 Using Bit Operations

INTERNAL ERROR MISSING SOURCE FILE: activities/float_2048/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest float_2048 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_float_2048 float_2048.c

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Challenge Exercise — individual:
Compare Floats Using Bit Operations

INTERNAL ERROR MISSING SOURCE FILE: activities/float_less/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest float_less 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_float_less float_less.c

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Challenge Exercise — individual:
Print A Float Using Only putchar and puts

INTERNAL ERROR MISSING SOURCE FILE: activities/float_print/index.html

When you think your program is working, you can use autotest to run some simple automated tests:

1521 autotest float_print 

When you are finished working on this exercise, you must submit your work by running give:

give cs1521 lab07_float_print float_print.c

You must run give before Monday 28 October 12:00 (midday) (2024-10-28 12:00:00) to obtain the marks for this lab exercise. Note that this is an individual exercise, the work you submit with give must be entirely your own.

Submission

When you are finished each exercises make sure you submit your work by running give.

You can run give multiple times. Only your last submission will be marked.

Don't submit any exercises you haven't attempted.

If you are working at home, you may find it more convenient to upload your work via give's web interface.

Remember you have until Week 8 Monday 12:00:00 (midday) to submit your work without receiving a late penalty.

You cannot obtain marks by e-mailing your code to tutors or lecturers.

You check the files you have submitted here.

Automarking will be run by the lecturer several days after the submission deadline, using test cases different to those autotest runs for you. (Hint: do your own testing as well as running autotest.)

After automarking is run by the lecturer you can view your results here. The resulting mark will also be available via give's web interface.

Lab Marks

When all components of a lab are automarked you should be able to view the the marks via give's web interface or by running this command on a CSE machine:

1521 classrun -sturec