, , , , ,

[SOLVED] Cse1320-004/005 hw 3 purpose: use bit operations to extract information

$25

File Name: Cse1320-004/005_hw_3__purpose:__use_bit_operations_to_extract_information.zip
File Size: 687.66 KB

5/5 - (1 vote)

Purpose: Assignment: Computers sometimes use a format called binary coded decimal or ‘BCD’.  Good background information is available from https://en.wikipedia.org/wiki/Binary-coded_decimal , but it is far deeper than you need for this assignment. (read at your own risk, the section marked “Basics” covers all you need to know at this point in time). BCD encodes a decimal number into 4 binary digits.  A byte holds 2 BCD digits.   A 32 bit word can contain 8 packed BCD digits.  Example: The decimal number 4660. Expressed as hex, it is 0x1234. In BCD, it is 0100 0110 0110 0000 or 4660 BCD or 18016 base 10. The decimal number 9999.  As hex it is 0x270F In BCD, it is 1001 1001 1001 1001, or 9999 BCD, or 39,321 base 10. Write a program that accepts an integer input (base 10) to stdin.   This input value is in packed BCD format.  Using the packed BCD format, display the number as a sequence of characters to stdout.  The sequence of characters is a simulation of a calculator’s display (5 characters wide, 5 characters tall, with a space between each).   Grading Criteria:   Example Output: $ gcc -Wall -std=c99 -g hw4.c$ ./a.out4660—   —   —   —        —-  —-|   | |   | |   | |   |     |    /      | ||   | |   | |   | |   |     |   /   —-  —-|   | |   | |   | |   |     |  /        |   ^—   —   —   —        —-  —-    ^305419896—-  —-       —-        —-   —|    /      | |    |     |        /  |   ||   /   —-  —- —-   —    /    —|  /        |   ^      | |   |  /    |   |—-  —-    ^  —-   —         —39321—   —   —   —   —   —   —   —|   | |   | |   | |   | |   | |   | |   | |   ||   | |   | |   | |   |  —   —   —   —|   | |   | |   | |   |     |     |     |     |—   —   —   —-1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Cse1320-004/005 hw 3 purpose: use bit operations to extract information
$25