Fundamentals of Data Representation for AQA GCSE Computer Science Page 1 by Nichola Lacey End of Chapter Recap
Total Page:16
File Type:pdf, Size:1020Kb
Teach yourself the Fundamentals of Data Representation for AQA GCSE Computer Science (8520) Students Workbook By Nichola Lacey Contents Introduction ............................................................................................................................................ 3 How to use this book .......................................................................................................................... 3 Who should use this book? ................................................................................................................. 3 What are number bases? ........................................................................................................................ 4 Decimal (base 10) ................................................................................................................................ 4 Binary (base 2) .................................................................................................................................... 5 What can be represented using binary? ............................................................................................. 7 Hexadecimal (base 16) ........................................................................................................................ 8 Why is hexadecimal used? .................................................................................................................. 8 End of chapter recap ......................................................................................................................... 11 Converting between number bases ...................................................................................................... 12 Convert from binary to decimal ........................................................................................................ 12 Convert from decimal to binary ........................................................................................................ 15 Number base notation ...................................................................................................................... 16 Convert from binary to hexadecimal ................................................................................................ 17 Convert hexadecimal to binary ......................................................................................................... 18 Convert hexadecimal to decimal ...................................................................................................... 19 Convert from decimal to hexadecimal .............................................................................................. 20 End of chapter recap ......................................................................................................................... 21 Units of information .............................................................................................................................. 22 Bits .................................................................................................................................................... 22 Bytes .................................................................................................................................................. 22 Amount of storage space required ................................................................................................... 23 End of chapter recap ......................................................................................................................... 23 Binary Arithmetic .................................................................................................................................. 24 Binary Shifts ...................................................................................................................................... 27 Teach yourself the fundamentals of data representation for AQA GCSE Computer Science Page 1 By Nichola Lacey End of chapter recap ......................................................................................................................... 28 Character encoding ............................................................................................................................... 29 7-bit ASCII .......................................................................................................................................... 29 Unicode ............................................................................................................................................. 32 End of chapter recap ......................................................................................................................... 33 Representing Images ............................................................................................................................. 34 Pixels ................................................................................................................................................. 34 Colour Depth ..................................................................................................................................... 37 Calculating file size ............................................................................................................................ 41 Converting binary into a bitmap ....................................................................................................... 42 End of chapter recap ......................................................................................................................... 45 Representing Sound .............................................................................................................................. 46 Creating a digital sound wave ........................................................................................................... 46 Calculate sound file sizes .................................................................................................................. 50 End of chapter recap ......................................................................................................................... 51 Data Compression ................................................................................................................................. 52 Huffman coding ................................................................................................................................. 54 Creating your Huffman code ......................................................................................................... 55 Calculating the bits used with data compression ............................................................................. 61 Run Length Encoding (RLE) ............................................................................................................... 63 End of chapter recap ......................................................................................................................... 65 Answers ................................................................................................................................................. 66 Teach yourself the fundamentals of data representation for AQA GCSE Computer Science Page 2 By Nichola Lacey Introduction Computers store text, images and sound as binary and this book has been written to give you practical hands-on approach to help you learn how this is done and how data is compressed to save file size. Instead of chapters of technical jargon and mind-numbing tedium the theory is broken down into smaller, manageable chunks with practical tasks for you to perform as you go along. This helps you understand the theory and remember it as you apply it to practical problems. How to use this book It is recommended that you start at the beginning and work through the chapters in order as each chapter builds on the knowledge you have gained from the previous one. You are not expected to be a passive passenger on this journey; if you want to know how data is represented in computer systems you will need to do a bit of work to achieve this. It is highly recommended that you do perform the tasks as instructed, even if some of them seem a little bizarre. They are all included for a reason and will help you learn the theory behind data representation. If you get stuck the answers, where there is a definite answer, to all the tasks are given at the back (page 66) of this book but try not to cheat and give the tasks a go. Who should use this book? This book was specifically written to assist students preparing for their AQA GCSE Computer Science examination (8520) and the objectives have been written specifically to match the syllabus, as of February 2018. However, the theory and methods would be beneficial to anybody who wants to know how data is represented in computer systems. Teach yourself the fundamentals of data representation for AQA GCSE Computer Science Page 3 By Nichola Lacey What are number bases? Objective: Understand the following number bases: decimal (base 10), binary (base 2) and hexadecimal (base 16). Decimal (base 10) Since you first learnt to recognise numbers you have been taught to use a base 10 number system, this is A decimal number known as a decimal (or denary) number base. It has 10 system uses 10 digits (0 – different digits, 9) to represent the value. 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 There is no single digit for the number ten and we use two digits (a 1 and a 0) to represent the place value we know as