Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 34

Unit 1 practice questions

Right Shift , Left Shift and 2’s Complement

Task 1
1. (a) Apply a right shift of one binary place on the following byte.

1 0 0 1 1 1 1 0

(b) Convert the original and shifted binary numbers into denary.

(c) What is the effect of the logical right shift?

2. (a) Apply a left shift of one binary place on the following byte.

0 1 0 1 1 0 1 0

(b) Convert the original and shifted binary numbers into denary.

(c) What is the effect of the binary shift?

3. (a) The binary number: 1101 1001 is stored in an 8-bit register. A right shift is carried out and the
result is stored in the register. After processing, state the binary value stored in the register.

(b) State the denary value stored in the register before and after the right shift.

Before:

After:

1
(c) Explain the problem that has occurred with the least significant bit stored in the register.

Task 2
1. Complete the table below by converting the binary numbers shown to their two’s complement. Also add
in the denary equivalent of all binary numbers shown.
The first row has been completed for you.

Binary number Denary equivalent Two’s complement Denary equivalent

0101 0001 81 1010 1111 -81

0110 0110

0011 0111

0101 0100

0000 0000

1101 0101

1000 0110

2
Answers
Task 1
3. (a) Apply a right shift of one binary place on the following byte.

1 0 0 1 1 1 1 0
0 1 0 0 1 1 1 1

(b) Convert the original and shifted binary numbers into denary.
158 and 79

(c) What is the effect of the logical right shift?


It divides the number by 2.

4. (a) Apply a left shift of one binary place on the following byte.

0 1 0 1 1 0 1 0
1 0 1 1 0 1 0 0

(b) Convert the original and shifted binary numbers into denary.
90 and 180

(c) What is the effect of the binary shift?


It multiplies the number by 2.

3. (a) The binary number: 1101 1001 is stored in an 8-bit register. A right shift is carried out and the
result is stored in the register. After processing, state the binary value stored in the register.
0110 1100

(b) State the denary value stored in the register before and after the right shift.
Before: 217
After: 108

(c) Explain the problem that has occurred with the least significant bit stored in the register.
The least significant bit was storing 1. When the right shift occurs this information is lost, resulting
in the number being rounded down / the 0.5 is lost.

3
Answer
Task 2
1. Complete the table below by converting the binary numbers shown to their two’s complement. Also add
in the denary equivalent of all binary numbers shown.
The first row has been completed for you.

Binary number Denary equivalent Two’s complement Denary equivalent

0101 0001 81 1010 1111 -81

0110 0110 102 1001 1010 -102

0011 0111 55 1100 1001 -55

0101 0100 84 1010 1100 -84

0000 0000 0 0000 0000 (the actual 0


number produced will
be 1 0000 0000, but
the 1 is larger than 8
bit so this will not be
stored).

0010 1011 43 1101 0101 -43

0111 1010 122 1000 0110 -122

4
Binary Addition
1. Start with this simple addition. (You can use rules (a) and (b) to help you if necessary.) Calculate
the denary equivalent to check that it is correct.

8 4 2 1 Denary equivalent

0 0 1 1 = 3
+ 0 1 0 0 = +
= = =

2. Use the same techniques as you did in the last question to find the binary result.

0 0 0 1
+ 1 1 0 0
=

3. Now use rule (d) to help with this problem. Use the carry row at the top for the carried 1.

0 0 1 1
+ 1 0 1 0
=

4. This one will carry into a new column. Remember that like in denary addition, the last carry just makes
the number bigger and is added on to the left of the number.

1 0 1 0
+ 1 0 1 1
=

5
5. Use rule (e) in this question. Use the carry row again and remember: 1+1+1 = 1 carry 1.

0 1 1 0
+ 1 1 1 0
=

6. Now try a full 8-bit binary number. Apply the same rules as before.

1 0 0 0 1 0 1 1
+ 0 1 0 0 1 0 1 0
=

7. Here is another 8-bit number that requires you use all of the rules.

1 0 0 1 1 1 1 0
+ 0 1 0 1 1 0 1 0
=

8. Now try without the help of the grid or rules (a) to (e) to refer to.

1 0 1 0 0 1 0 1
+ 0 0 1 1 1 1 0 0
=

Answer
6
1. Start with this simple addition. (You can use rules (a) and (b) to help you if necessary.) Calculate
the denary equivalent to check that it is correct.

8 4 2 1 Denary equivalent
0 0 1 1 = 3
+ 0 1 0 0 = + 4
= 0 1 1 1 = = 7

2. Use the same techniques as you did in the last question to find the binary result.

0 0 0 1
+ 1 1 0 0
= 1 1 0 1

3. Now use rule (d) to help with this problem. Use the carry row at the top for the carried 1.

1
0 0 1 1
+ 1 0 1 0
= 1 1 0 1

4. This one will carry into a new column. Remember that like in denary addition, the last carry just makes
the number bigger and is added on to the left of the number.

1 1
1 0 1 0
+ 1 0 1 1
= 1 0 1 0 1

5. Use rule (e) in this question. Use the carry row again and remember: 1+1+1 = 1 carry 1.

1 1 1
0 1 1 0
+ 1 1 1 0
= 1 0 1 0 0

6. Now try a full 8-bit binary number. Apply the same rules as before.

1 1
1 0 0 0 1 0 1 1
+ 0 1 0 0 1 0 1 0
= 1 1 0 1 0 1 0 1

7. Here is another 8-bit number that requires you use all of the rules.

1 1 1 1
1 0 0 1 1 1 1 0
+ 0 1 0 1 1 0 1 0
= 1 1 1 1 1 0 0 0

8. Now try without the help of the grid or rules (a) to (e) to refer to.

1 1 1 1
1 0 1 0 0 1 0 1
+ 0 0 1 1 1 1 0 0
= 1 1 1 0 0 0 0 1

7
An 8-bit binary number holds 256 different numbers – 0-255. When the result of the addition is greater than
255, an overflow error occurs.

ASCII Codes and Unicode

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]

8
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]

Answers
1. A simple three-letter code word is saved to a hard disk.
9
(a) What is the size in bytes of the code word? 3 [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? CAB [3]

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

(d) Calculate the denary value representing the letter E. 69 [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? 0100 1100 [1]

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


Convert the ASCII string ‘76’ to binary. [1]
00110111 00110110

(c) Give two advantages of representing integers in binary rather than ASCII. [2]
Binary numbers take up much less space / e.g. the string 76 needs two bytes,
but the integer needs just 1 byte.
Calculations are much simpler.

3. (a) Name one limitation of the 8-bit extended ASCII character set. [1]
Only 256 characters can be represented, so there is no way of representing characters from large
character sets such as Japanese/Chinese.
(b) Explain how these limitations can be overcome. [2]
By using more bits for each character / Unicode which uses 16 bits (1).
so that there are more available combinations to store the new characters (1).

Sound file size

10
1. The length of a recording will heavily influence the size of the sound file.

State two factors other than recording length that determine the file size of a recording. [2]

2. A portable sound recorder is used to record an interview.

The recorder uses the following settings:


 Frequency: 20 kHz
 Resolution: 20 bits
 Time: 1 minute 40 seconds

Calculate the file size of the interview in megabytes. [5]

ANSWER

1. The length of a recording will heavily influence the size of the sound file.

State two factors other than recording length that determine the file size of a recording. [2]

Sample rate / interval / frequency.


Sample resolution / (audio) bit depth.

2. A portable sound recorder is used to record an interview.

The recorder uses the following settings:


 Frequency: 20 kHz
 Resolution: 20 bits
 Time: 1 minute 40 seconds

Calculate the file size of the interview in megabytes. [5]

File size = 20 kHz x 20 bits x 100 seconds (1)


File size = 40 000 000 bits (1)
File size = 40 000 000 / 8 = 5 000 000 bytes (1)
File size = 5 000 000 / (10242) = 4.77 MB (2)

1 mark for each stage in the calculation. Award full marks if the correct answer and unit are given but
intermediate workings are not shown. 1 mark is given for the unit (MB/megabytes).
IMAGE File Size

11
1. State two factors that affect the file size of a bitmap image. [2]

2. Calculate the file size of each of the following images. [2]


a. A 256 colour icon with dimensions of 50 × 50 pixels

b. A 16 colour icon with dimensions of 100 × 100 pixels


……………………………………………………………………………………………………………
3. A digital camera takes an image with the following properties:
 Resolution: 10 Megapixels (10 000 000 pixels)
 Colour depth: 24 bits
Calculate the file size in mebibytes. [3]

ANSWER
1. State two factors that affect the file size of a bitmap image. [2]
Colour depth / number of bits per pixel / number of colours in the image.
12
Dimensions of the image in pixels / resolution. ‘Size of the image’ is not enough.

2. Calculate the file size of each of the following images. [2]

a. A 256 colour icon with dimensions of 50 × 50 pixels


256 colours require 8 bits = 1 byte. 50 × 50 = 2 500 pixels. Size = 2 500 bytes

b. A 16 colour icon with dimensions of 100 × 100 pixels


16 colours require 4 bits.
100 × 100 = 10 000 pixels, × 4 bits = 40 000 bits / 8 = 5 000 bytes.

3. A digital camera takes an image with the following properties:

 Resolution: 10 Megapixels (10 000 000 pixels)


 Colour depth: 24 bits
Calculate the file size in mebibytes. [3]

Answers include:
size = resolution x colour depth
size = 10 000 000 pixels x 24 bits per pixel (1)
size = 240 000 000 bits
size = 240 000 000 / 8 = 30 000 000 bytes (1)
size = 30 000 000 / (10242) = 28.6 MiB (1)
1 mark for each stage. Award 3 marks if there is a correct answer with units. Units are either MiB or
mebibytes.

COMPRESSION
1. (a) Give two reasons why you might compress photographic files
before emailing them. [2]

13
Reason 1.

Reason 2:

(b) Two forms of compression are lossy and lossless.


Explain the most suitable form of compression to use when transmitting:
(i) a draft manuscript for a book. [2]

(ii) A video recording which you have made of the school play. [2]

2. A music production company needs to save music at the highest quality possible. They would like to
make use of compression if possible.
Explain how compression can help the music production company. [2]

14
3. An algorithm called Run Length Encoding is used to compress an image. It converts the file by
recording the colour code, represented here by a letter, followed by the number of pixels of the same
colour, e.g. R4.
(a) Give the result of applying the algorithm to the following data for an image: [2]

G G G G G R R R Y Y Y Y Y Y R R R G G G G

(b) Is this lossy or lossless compression?


Explain your answer: [2]

4. Describe the effect of reducing the resolution and colour depth of an image. [3]

15
Answers
1. (a) Give two reasons why you might compress photographic files
before emailing them. [2]
Reason 1. Files take less time for the receiver to download.
Reason 2: The file size may exceed the limit of what can be attached to an email.
Or another reason such as reducing the storage size on a friend’s computer / email storage quota.

(b) Two forms of compression are lossy and lossless.


Explain the most suitable form of compression to use when transmitting:
(i) a draft manuscript for a book. [2]
Lossless – the manuscript cannot lose any of its content while being transmitted.
(ii) A video recording which you have made of the school play. [2]
Lossy – the file will be much smaller, and the quality will still be acceptable.

2. A music production company needs to save music at the highest quality possible. They would like to
make use of compression if possible.
Explain how compression can help the music production company. [2]
The file size of the compressed file will be smaller (1) so take up less storage space (1) or be faster to
upload / transmit / email (1).

3. An algorithm called Run Length Encoding is used to compress an image. It converts the file by
recording the colour code, represented here by a letter, followed by the number of pixels of the same
colour, e.g. R4.
(a) Give the result of applying the algorithm to the following data for an image: [2]
G G G G G R R R Y Y Y Y Y Y R R R G G G G

G5R3Y6R3G4
(b) Is this lossy or lossless compression?
Explain your answer: [2]
Lossless – no data is lost by the compression/decompression process and the image will be
restored exactly as the original data.

4. Describe the effect of reducing the resolution and colour depth of an image. [3]
Reducing the colour depth or resolution will result in a reduced file size. (1)
Data will be permanently lost by doing this. (1)
A reduction in colour depth will give a reduced number of colours that can be used resulting in a lower
quality image / gradations will have sudden changes in colour. (1)
A reduction in the resolution / number of pixels in the image will result in the image being lower quality
(assuming both images are displayed at the same physical size). (1)
Accept other appropriate examples of how resolution and colour depth changes affect image size.

16
Past Paper Questions
Q1.
Jamelia wants to store an image file. The image has an 8-bit resolution and is 150 pixels by
100 pixels in size.
Calculate the file size of the image. Give your answer in kilobytes (kB). Show all of your
working.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
File size ........................................................................................................... kB

Q2.Six binary or hexadecimal numbers and six denary conversions are given.
Draw a line to connect each binary or hexadecimal number to the correct denary conversion.

(b) Hexadecimal is often used by computer programmers to represent binary values.


Explain why computer programmers may choose to use hexadecimal.
...................................................................................................................................................
...................................................................................................................................................
17
...................................................................................................................................................
.............................................................................................................................................. [2]

Q3.

18
19
Q4.

20
Q5.

21
22
Q6.

23
24
Q7.

Q8.

25
Q9.

Q10.

26
Q11.

27
Q12.

28
29
30
31
Q13.

32
33
34

You might also like