SAMPLE. Computer Science. Essential Maths Skills. for AS/A-level. Gavin Craddock and Victoria Ellis

Similar documents
Computer Science 281 Binary and Hexadecimal Review

Useful Number Systems

Positional Numbering System

Base Conversion written by Cathy Saxton

CSI 333 Lecture 1 Number Systems

Binary Adders: Half Adders and Full Adders

NUMBER SYSTEMS. 1.1 Introduction

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Lecture 2. Binary and Hexadecimal Numbers

Binary Numbers. Binary Octal Hexadecimal

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Numbering Systems. InThisAppendix...

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Number Systems and Radix Conversion

DNA Data and Program Representation. Alexandre David

Section 1.4 Place Value Systems of Numeration in Other Bases

NUMBER SYSTEMS. William Stallings

Solution for Homework 2

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Welcome to Basic Math Skills!

Chapter 4: Computer Codes

Data Storage 3.1. Foundations of Computer Science Cengage Learning

The string of digits in the binary number system represents the quantity

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Basic Use of the TI-84 Plus

General Certificate of Education Advanced Subsidiary Examination June 2015

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers.

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Gates, Circuits, and Boolean Algebra

=

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Classful Subnetting Explained

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

Lecture 8: Binary Multiplication & Division

MATH-0910 Review Concepts (Haugen)

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:

CPEN Digital Logic Design Binary Systems

Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring I-Before-E, Continued

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

A-level COMPUTER SCIENCE

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Two's Complement Adder/Subtractor Lab L03

Circuits and Boolean Expressions

IP Subnetting and Related Topics A Tutorial by Chris Uriarte <chrisjur@cju.com> Updated April 2001

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Chapter 3. if 2 a i then location: = i. Page 40

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

COMPSCI 210. Binary Fractions. Agenda & Reading

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Chapter 1: Digital Systems and Binary Numbers

2011, The McGraw-Hill Companies, Inc. Chapter 3

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables

Number of bits needed to address hosts 8

for ECM Titanium) This guide contains a complete explanation of the Driver Maker plug-in, an add-on developed for

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

THE BINARY NUMBER SYSTEM

CHAPTER 5 Round-off errors

Binary Representation

Introduction. The Quine-McCluskey Method Handout 5 January 21, CSEE E6861y Prof. Steven Nowick

Adaptive Stable Additive Methods for Linear Algebraic Calculations

Grade 6 Mathematics Performance Level Descriptors

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

BOOLEAN ALGEBRA & LOGIC GATES

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Lecture 11: Number Systems

Systems I: Computer Organization and Architecture

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Eastern Washington University Department of Computer Science. Questionnaire for Prospective Masters in Computer Science Students

Grade Level Year Total Points Core Points % At Standard %

Unsigned Conversions from Decimal or to Decimal and other Number Systems

Addition Methods. Methods Jottings Expanded Compact Examples = 15

Numerical Matrix Analysis

Number and codes in digital systems

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

CE363 Data Communications & Networking. Chapter 6 Network Layer: Logical Addressing

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

CONTENTS. Please note:

F.IF.7b: Graph Root, Piecewise, Step, & Absolute Value Functions

Introduction to Xilinx System Generator Part II. Evan Everett and Michael Wu ELEC Spring 2013

2.3 IPv4 Address Subnetting Part 2

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Classless Subnetting Explained

Arithmetic Coding: Introduction

Math Content by Strand 1

Decimal to Binary Conversion

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

Here are some examples of combining elements and the operations used:

Transcription:

Essential Maths Skills for AS/A-level Computer Science Gavin Craddock and Victoria Ellis Series Editor Heather Davis Educational Consultant with Cornwall Learning

Contents The listed content is assessed by the awarding bodies AQA, OCR, Pearson Edexcel and WJEC at AS and A-level. 1 2 3 4 5 Number systems and sets Number systems Sets (AQA A-level only) Number bases Converting a Base 2 or Base 16 Number to Base 10 Converting a Base 10 to a Base 2 or Base 16 Number Units (AQA only) Binary prefixes Decimal prefixes Converting Between Values Arithmetic operations in a programming language Mod DIV Power Rounding and Truncating Logical Operations Binary numbers Signed vs Unsigned Binary Key values for n bits Binary Addition Binary Multiplication Representing Negative Numbers Two s Complement Fixed Point

Logical Shifts (A-level only) Bitwise Operators (A-level only) 6 7 8 9 Floating Point Data Representation Representation of real numbers in binary Floating point binary Normalisation Range and precision Absolute and relative errors Representing images, sound and other data (AQA only) Bitmap images Sound samples Boolean algebra Logic gates Boolean algebra Boolean identities and De Morgan s laws Vectors (AQA A-level only) Vector Representation Vector Addition 10 Scalar Vector Multiplication Dot product of two vectors Convex combination of two vectors Big-O notation and Complexity of Algorithms Functions Complexity of algorithms (A-level only) Exam-style questions Appendix: Cross referencing essential maths skills with exam board topics

2 Number bases Decimal, binary and hexadecimal number base Number base means the number of different symbols that are used. So if you have base 10 (known as decimal, or denary), there are 10 different symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. These symbols are then combined to represent any number, e.g. 12, 99, 386. Binary is base 2 and there are two different symbols: 0 and 1. Hexadecimal is base 16 and there are 16 different symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Letters are used in hexadecimal instead of two digit numbers. The base of a number can be identified by its subscript: If the subscript is 10, e.g. 9 10, this means it is a base 10 number (decimal). If the subscript is 2, e.g. 1011 2, this means it is a base 2 number (binary). If the subscript is 16, e.g. 281 16, this means it is a base 16 number (hexadecimal). Converting a base 2 or base 16 number to base 10 Each digit in a number can be converted into its decimal (base 10) value using four steps. Table 2.1 shows how the digits are divided. In computer science we start counting at 0. The first digit (on the right) is Digit 0 (D0). This is multiplied by its base to the power of 0 (base 0 ). Digit 1 (D1) is multiplied by its base to the power of 1 (base 1 ). Digit 2 (D2) is multiplied by its base to the power of 2 (base 2 ) and so on. Table 2.1 D4 D3 D2 D1 D0 base 4 base 3 base 2 base 1 base 0 Multiplying to the power of 2 means the number multiplied by itself, i.e. 4 2 = 4 4. Multiplying to the power of 3 means the number multiplied by itself, multiplied by itself, i.e. 4 3 = 4 4 4. A = 10 B = 11 C = 12 D = 13 E = 14 F = 15 2 Number bases 1

2 Number bases A Worked examples a Convert the binary number 0101 to decimal. Step 1: put the binary number into the table format as shown in Table 2.1. Table 2.2 0 1 0 1 base 3 base 2 base 1 base 0 Step 2: binary is base 2, so replace the word base with 2. Table 2.3 0 1 0 1 2 3 2 2 2 1 2 0 Step 3: calculate each column. Table 2.4 0 2 3 = 0 1 2 2 = 4 0 2 1 = 0 1 2 0 = 1 Step 4: Add the columns together. 0 + 4 + 0 + 1 = 5 b Convert the hexadecimal number 1D9 to decimal. Step 1: put the hexadecimal number into the table format as shown in Table 2.1. Table 2.5 0 D 9 base 2 base 1 base 0 Step 2: hexadecimal is base 16, so replace the word base with 16. Table 2.6 0 D 9 16 2 16 1 16 0 Step 3: Calculate each column, replacing any letters with their numerical equivalent. (D = 13; see box on the previous page) Table 2.7 1 16 2 = 256 13 16 1 = 208 9 16 0 = 9 Step 4: add the columns together. 256 + 208 + 9 = 473 2 Full worked solutions at www.hoddereducation.co.uk/essentialmathsanswers

B Guided questions Copy out the workings and complete the answers on a separate piece of paper. 1 Convert the binary number 11100 to denary. Show your working. Step 1: fill in the number base for binary in each column. The first one has been done for you. Table 2.8 1 1 1 0 0 2 4 3 2 1 0 Step 2: complete the calculation for each column. Again, the first one has been done for you. 16 + + + + The answer is. 2 Convert the hexadecimal number 3F to denary. Show your working. C Step 1: fill in the second hexadecimal number on the top row and the bases on the bottom row. Table 2.9 3 1 0 Step 2: complete the calculation for each column. + The answer is. Practice questions 3 Convert the binary number 1011 to decimal. 4 Convert the hexadecimal number 29 to decimal. 5 Convert the binary number 10111 to decimal. 6 Convert the hexadecimal number AB to decimal. 7 Convert the binary number 10110110 to decimal. 8 Convert the hexadecimal number 32F1 to decimal. 2 Number bases 2 Number bases 3