St Andrew’s High School Computing Science Software Design and Development Unit Low Level Operations and Computer Architecture Ink Exercise Booklet Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 1 – Binary – Positive Numbers – National 4/5 1. Give two reasons why computer systems use the binary number system. 2 2. What is the largest number that your computer could represent using (a) 8 bits (b) 4 bits 2 3. Convert the following decimal numbers to 8-bit binary. (a) 127 (b) 56 (d) 225 (e) 1 (c) 23 5 4. Convert the following binary numbers to decimal (a) 01010010 (b) 01010101 (c) 11001011 (d) 11110000 (e) 11111100 (f) 11111111 6 Total 15 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 2 – Bit Mapped Graphics – National 5 1. Describe two disadvantages of storing graphics in bit-mapped form compared with other methods. 2 2. Describe one advantage of storing graphics in bit-mapped form compared with other methods. 1 3. What is meant by the term resolution? 1 4. What is meant by the term resolution dependent? 5. Describe how a bit map graphic is stored. 6. Calculate the storage requirements for a black and white bit-mapped graphic measuring 8 inch by 8 inch at 600 dpi? Show all working and answer in appropriate units. 1 1 3 7. Calculate the storage requirements for a 3 inch x 4 inch, black and white bit-mapped graphic on a monitor using 800 * 1200 pixels? Show all working and answer in appropriate units. 8. Calculate the storage requirements for a black and white bit-mapped graphic measuring 5 inch by 6 inch at 1200 dpi? Show all working and answer in appropriate units. 3 3 9. How many different colours can be represented when a graphic package uses a colour depth of 8 bits? 10. If each pixel of a graphic can display 16 colours, how many bits are stored for each pixel? 2 11. 2 What are the implications for the storage needed for a graphic if we increase the colour depth from 1 bit to 2 bits per pixel? 1 Total 20 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 3 – Text Representation – National 4/5 1. 2. 3. 4. 5. 6. 7. Why is it important to have an internationally accepted system like ASCII codes for representing alphanumeric characters? 2 The ACSII codes 0 to 31 are sometimes called the control character codes because they have no printable character associated with them and they normally provide a 'control' function. Give an example of two of these codes and what their functions would be. 2 What difficulties would occur if every computer manufacturer used their own codes for representing text? 2 What is the difference between ASCII and extended ASCII? 2 What is a character set? 3 What is the character for the ASCII codes 64 and 119? 2 Why are there different ASCII codes for lower and upper case letters? 2 Total 15 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 4 – Floating Point Representation – National 5 1. Why is there a need to represent numbers using floating point representation? 2 2. Describe how a floating point number is stored in a computer system. 2 3. How would .11001010 be stored in a computer system? 4. 2 Convert the following binary numbers into floating point representation (using 8 bits for the mantissa and 4 bits for the exponent) (a) 111.1011 (b) 100001.11 (d) 101.0001 (e) 10001.101 (c) 11.1011 10 5. If you have 12 bits for your mantissa and 4 bits for your exponent, what is the largest and smallest positive number that you can represent? 2 6. If you have 8 bits for your mantissa and 6 bits for your exponent, what is the range of positive and negative numbers that you can represent? 2 Total 20 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 5 – Translators/Twos Complement/Computer Architecture – National 5 1. Describe how a compiler works. (2 marks) 2. Describe how an interpreter works. (2 marks) 3. Why does a compiled program have a faster run time than an interpreted program? (2 marks) 4. If a programmer wants to have a program that is easy to edit but runs fast, what type of translator would you advise him to use? (2 marks) 5. Show how the values -45, -55, and -66 are encoded? (3 marks) 6. Name the parts of the processor. (3 marks) 7. Which part of the processor would be involved in an IF… then condition? (1 mark) 8. Where is a computer game stored when a user is playing it? (1 mark) 9. What type of memory cannot be changed? (1 mark) 10. Which bus points to a memory location? (1 mark) 11. Why is the data bus bi-directional? (1 mark) 12. What is the purpose of the clock line in the control bus do? (1 mark) 13. Describe serial transmission of data. (1 mark) 14. Describe parallel transmission of data. (1 mark) Total 22 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 6 – Text/Positive Number/Units of Storage/Instructions – National 4/5 1. Describe how ASCII is used to represent text. (1 mark) 2. What is meant by a control character? (1 mark) 3. What is meant by a character set? (3 mark) 4. Convert the following decimal numbers into binary. (a) 200 (b) 123 (c) 199 5. (c) 1000001 (d) 11000010 (4 marks) (b) 256 bits (2 marks) Calculate the following into Kilobytes. (a) 1 Mb 8. (b) 10101001 Calculate the following into bytes. (a) 1 Mb 7. (4 marks) Convert the following binary numbers into decimal. (a) 101001 6. (d) 63 (b) 2048 bytes (2 marks) Work out the range of numbers which could be used for storing positive integers with the following number of bits. (a) 2 bits (b) 4 bits (c) 8 bits (3 marks) 9. Describe one reason why the binary system is used to represent data within a computer system. (1 mark) 10. What language does a computer understand? (1 mark) 11. Why do we not program in the computers language? (1 mark) 12. What is the computers language made up of? (1 mark) Total 24 Nat 4/5 Computer Science Ink Exercises – Low Level Operations and Computer Architecture Ink Exercise 7 – Real Numbers/Bit-Mapped/Vector – National 5 1. Describe how a real number is stored within a computer system. 2. Show how the following real binary numbers are represented using 8 bits for the mantissa and 4 bits for the exponent. (a) 11000.111 (b) 1100.1010 (2 marks) (2 marks) 3. Calculate the amount of storage required for a 600 dpi black and white bit-mapped graphic which is 6 inches by 4 inches. (2 marks) 4. Describe how a graphic is stored using the bit mapped method. (2 marks) 5. Describe how a graphic is stored using the vector method. (2 marks) 6. Identify whether the following graphics are bit-mapped or vector: (2 marks) (a) (b) Total 12 Nat 4/5 Computer Science