Exercise: Bits, Bytes, Data Types
- Write 39 in binary.
- Write 10101010 in decimal.
- Write your first name as a series of ASCII codes (use decimal). For example, Tom (not TOM or tom) would be 84, 111, 109
- How many bits would be needed for a code to represent just the upper and lower case letters and numbers (no punctuation, etc.)?
- In the table of data types, note that the logical character type is 8 bits long.
- Strictly (mathematically) speaking, does it have to be 8 bits?
- If so, why?
- If not, why is it 8 bits long?
- Consider scheme for representing floating point numbers with 2 bytes. The sign for mantissa and exponent each use 1 bit, the mantissa uses 10 bits and the exponent uses the rest.
- What is the largest positive number that can be represented?
- What is the smallest, non-zero, positive number that can be represented?
- Aproximately how many significant decimal places are available with this scheme?
|