Computer Systems Nat 45 Computing Science Lesson 1

  • Slides: 14
Download presentation
Computer Systems Nat 4/5 Computing Science Lesson 1: Binary

Computer Systems Nat 4/5 Computing Science Lesson 1: Binary

Section Key Terms KEY Section Key Words WORDS

Section Key Terms KEY Section Key Words WORDS

Lesson Aims By the end of this lesson: You will be able to: ü

Lesson Aims By the end of this lesson: You will be able to: ü Describe what an integer is ü Convert decimal numbers to binary ü Convert binary numbers to decimal ü Represent positive integers in binary using up to 8 Bits ü State three advantages of the binary number system

Binary numbers in 60 seconds http: //www. youtube. com/watch? v=qd. Fm. Sl. Foj. Iw

Binary numbers in 60 seconds http: //www. youtube. com/watch? v=qd. Fm. Sl. Foj. Iw

Nat 4/5 Integers An integer is a whole number No fractions or decimals, no

Nat 4/5 Integers An integer is a whole number No fractions or decimals, no ¾ or 0. 75 Only whole numbers such as 2, 96, 127, 2034 Integers that are 1 or greater are known as positive integers

Nat 4/5 The Decimal & Binary Systems We use the decimal(denary) or base 10

Nat 4/5 The Decimal & Binary Systems We use the decimal(denary) or base 10 system This means we have 10 digits : 0 -9 Because of our ten fingers? Computers use the binary or base 2 system There are only two digits: 0 and 1 Each figure is known as a bit Binary digit Off and On

Nat 4/5 Decimal Numbers Lets look at how a decimal number is made up:

Nat 4/5 Decimal Numbers Lets look at how a decimal number is made up: 173 Hundreds Tens Units 1 7 3 102 101 100 Hundreds Tens Units 1 7 3 Technically this is:

Nat 4/5 Binary Numbers Lets look at how the same number is stored in

Nat 4/5 Binary Numbers Lets look at how the same number is stored in binary: 1010 1101 128 64 32 16 8 4 2 1 1 0 1 This number is constructed as shown above. These values come from: 27 26 25 24 23 22 21 20 1 0 1

Nat 4/5 How to convert into Binary Let’s look at the same example: 173/2

Nat 4/5 How to convert into Binary Let’s look at the same example: 173/2 = 86 r 1 Our binary number is: 86/2 = 43 r 0 1010 1101 43/2 = 21 r 1 21/2 = 10 r 1 Read the binary 10/2 = 5 r 0 number from bottom up 5/2 = 2 r 1. 2/2 = 1 r 0 1/2 = 0 r 1 This is our binary number Binary Number = 1010 1101

Nat 4/5 How to convert into Binary Using the number 173 earlier. The aim

Nat 4/5 How to convert into Binary Using the number 173 earlier. The aim is to subtract the values from the number until we are left with 0. Can we subtract 128 from 173? Yes – So we add a 1 to our number Read the binary Can we subtract 64 from 45? number from top No so we add a 0 down Can we subtract 32 from 45? Yes so we add a 1 Can we subtract 16 from 13? No so we add a 0 Can we subtract 8 from 13? Our binary number is: Yes so we add a 1 1010 1101 Can we subtract 4 from 5? Yes so we add a 1 Can we subtract 2 from 1? No so we add a 0 Can we subtract 1 from 1? Yes so we add a 1

Nat 4/5 How to convert from Binary 1. 2. 3. Create your table with

Nat 4/5 How to convert from Binary 1. 2. 3. Create your table with the values in the top 128 64 32 16 8 4 2 1 0 1 1 0 Insert your binary value into the table Add the place values that have a binary 1 in them: 64+32+4+2 = 102

Nat 4/5 Advantages of the Binary system There are less rules of arithmetic, this

Nat 4/5 Advantages of the Binary system There are less rules of arithmetic, this makes it easier to program. 0’s and 1’s are easier to represent digitally in computer systems. Any drop in voltage does not affect the data.

Nat 4/5 Summary Binary only has two values– 0 & 1 A single 0

Nat 4/5 Summary Binary only has two values– 0 & 1 A single 0 or 1 is known as a bit Binary Digit The place values in binary start on the right at 1 and double every time going to the left. Advantages of Binary: 1. There are less rules of arithmetic. 2. 0’s and 1’s are easier to represent. 3. Any drop in voltage doesn’t effect data.

 The End

The End