0% found this document useful (0 votes)
2 views

1.2 Homework 1 (1)

The document contains a series of questions related to binary representation, ASCII encoding, and programming concepts. It includes tasks such as calculating binary sizes, converting characters to binary and hexadecimal, and discussing the limitations of ASCII. The total marks for the questions are 20.

Uploaded by

minh024055
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

1.2 Homework 1 (1)

The document contains a series of questions related to binary representation, ASCII encoding, and programming concepts. It includes tasks such as calculating binary sizes, converting characters to binary and hexadecimal, and discussing the limitations of ASCII. The total marks for the questions are 20.

Uploaded by

minh024055
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name:............................................................................. Class:................... Mark:................

1. A simple three-letter code word is saved to a hard disk.

(a) What is the size in bytes of the code word? [1]

(b) The code word is represented on the disk in a binary format, saved as:

01000011 01000001 01000010

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]

(c) What is the hexadecimal representation of the code word? [2]

(d) Calculate the denary value representing the letter E. [1]

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]

(b) The ASCII character 7 is represented by the denary number 55.


Convert the ASCII string ‘76’ to binary. [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]

(b) Explain how these limitations can be overcome. [2]

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

(a) Explain what line 3 of the code does. [2]

(b) Explain what line 4 of the code does. [2]

(c) The program requires the age to be between 0 and 8.

Explain the problem that will occur if numbers outside this range are used. [2]

[Total 20 marks]

You might also like