Homework 1 |

You can either write your answers to theoretical questions on paper or
edit them in the file `hw1/paper.tex`. Please show all the
mathematical derivations that you perform.

- UT's ``burnt orange'' color is expressed by code
`#BF5700`, where each pair of symbols (`BF`,`57`, and`00`) refers to a hexadecimal (base 16) representation of the red, green, and blue components. Convert these numbers to an octal (base 8) and a decimal (base 10) representations. - The C program listed below, when compiled and
run from the command line, takes a string from the user and prints
out the string characters. Modify the program to output ASCII
integer codes for each character in the string. What is the ASCII
code for the special new line character ``
`\n`

''?#

**include****<stdio.h>***/* for printf and scanf */***int****main**(**void**) {**char***s, string[101]; printf(**"Input a string:"**); scanf(**"%100s"**,string);*/* loop over characters */***for**(s=string; *s !=**''**; s++) printf(**"%c"**,*s); } - Write a program that prints out ``little'' if the computer is
little-endian and ``big'' if the computer is big-endian. Test it on
your computer.
- In the IEEE double-precision floating-point standard, 64 bits
(binary digits) are used to represent a real number: 1 bit for the
sign, 11 bits for the exponent, and 52 bits for the mantissa. A
double-precision normalized non-zero number can be written in
this standard as

with , and for . What is the largest number that can be expressed in this system?

Homework 1 |

2014-09-08