Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / CS367 Project 2 -Spring 2022 1

CS367 Project 2 -Spring 2022 1

Computer Science

CS367 Project 2 -Spring 2022
1. Project Overview The Tachka Programmable calculator is a program designed to run on an embedded system. These systems typically do not have support for floats in hardware. In this case, the machine this will be running on supports a very low-power 16-bit microcontroller. You won’t have to worry about any of this, of course, but it means that it won’t be able to communicate using normal floats or doubles. Your job is to implement a software 16-bit floating point library. For this assignment, you will be implementing functions to create the nuqta 16-bit floating point library that Tachka will be using. You will be completing three functions in nuqta_lib.c for the API, however, it is highly recommended that you write a large number of helper functions. The Tachka calculator will use your library to convert standard C double type variables into custom 16-bit nuqta_t type encodings, and vice versa. You will also do some native arithmetic in this format, using the techniques covered in class, operating on nuqta_t values. 2. The Tachka Scripting Calculator The good news is that Tachka is already written; all you have to do is finish the API implementation for the nuqta functions in nuqta_lib.c that Tachka will use. This calculator is normally programmed using scripts, like how Python scripts are run. The Tachka scripts use the .tk extension and run the commands that will ultimately call your functions. Tachka can also run interactively from the command line without any inputs, in which case it will let you type in your operations, one per line, for it to execute. Tachka uses single-letter, lowercase variables only, so you can only use a through z Tachka only has four different operators: =, +, -, and * Tachka also has two commands: print and display To quit Tachka, you simply have to press the ENTER key when done. CS367 Project 2 – Custom Floating-Point Library Spring 2022 Page 2 of 14 Here is an example Tachka script with one statement per line: (sample.tk) x = -0.45 print x y = 5.15 print y a = x + y print a b = x - y print b c = x * y print c d = 1.0 print d display d This script inputs 13 commands into the Tachka Programmable Calculator. 3. Tachka Programmable Calculator Output Tachka outputs directly to the screen with the results of the operations or commands that are given. If you run a script, the output will be given all at once, as shown below with the output for the above (sample.tk) script. zeus-1:handout$ ./tachka sample.tk [Tachka-Script]$ x = -0.45 [Tachka-Script]$ print x x = -0.4501953125000000000000000000000000000000 [Tachka-Script]$ y = 5.15 [Tachka-Script]$ print y y = 5.1484375000000000000000000000000000000000 [Tachka-Script]$ a = x + y [Tachka-Script]$ print a a = 4.6953125000000000000000000000000000000000 [Tachka-Script]$ b = x - y [Tachka-Script]$ print b b = -5.6015625000000000000000000000000000000000 [Tachka-Script]$ c = x * y [Tachka-Script]$ print c c = -2.3164062500000000000000000000000000000000 [Tachka-Script]$ d = 1.0 [Tachka-Script]$ print d d = 1.0000000000000000000000000000000000000000 [Tachka-Script]$ display d d = 0011111000000000 [0x3e00] Exiting You can also run it directly from the command line without a script, just like with a Python interpreter. In this case, you’ll only get output after every print or display. CS367 Project 2 – Custom Floating-Point Library Spring 2022 Page 3 of 14 zeus-1:handout$ ./tachka [Tachka]$ a = 1.5 [Tachka]$ b = 3.2 [Tachka]$ c = a + b [Tachka]$ print c c = 4.7031250000000000000000000000000000000000 [Tachka]$ display c c = 0100001001011010 [0x425a] [Tachka]$ Exiting 4. Specification for Project 2 We’ve already written the Tachka Programmable Calculator for you and provided you with the stubs (empty functions) for the three functions you will be writing inside of nuqta_lib.c Complete this code, along with any number of helper functions that you would like to use, in order to implement these three functions. In this project, you will be working with our custom nuqta_t type variables. These are custom types that are 32-bit signed ints in memory. Within these 32-bits, you will be encoding our custom 16 bits floating point value. Since a nuqta_t type is just a standard int, you can do operations on it just like you normally would with a signed int. (eg. shifting, masking, and other bitwise ops). Ultimately, you will be getting the S, exp, and frac informatio

Option 1

Low Cost Option
Download this past answer in few clicks

120 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE