1.2 Homework 1 (1)
1.2 Homework 1 (1)
(b) The code word is represented on the disk in a binary format, saved as:
Character Binary
A 01000001
B 01000010
C 01000011
D 01000100
E 01000101
Using the section of the ASCII table above, what is the code word? [3]
1
2. Integers which are to be used in calculations are represented as binary numbers.
(a) What is the 8-bit binary representation of the number 76? [1]
(c) Give two advantages of representing integers in binary rather than ASCII. [2]
3. (a) Name one limitation of the 8-bit extended ASCII character set. [1]
2
4. The following program has been created.
1 OUTPUT "Enter your age in years (between 0-8): "
2 INPUT age
3 charNum ← ord(age)
4 charNum ← charNum + 1
5 age ← chr(charNum)
6 OUTPUT age
Explain the problem that will occur if numbers outside this range are used. [2]
[Total 20 marks]