Presentation is loading. Please wait.

Presentation is loading. Please wait.

GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers.

Similar presentations


Presentation on theme: "GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers."— Presentation transcript:

1 GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers

2 When we want to represent negative numbers, we used signed integers
Reminder An integer is a whole number, it can have a positive or negative value

3 Convert this sign and magnitude number to denary: 1 1111
Negative Numbers: Sign and Magnitude This is the simplest method of representing negative numbers in binary. The most significant bit is the sign bit. 1 = minus 0 = plus Sign bit 128 64 32 16 8 4 2 1 +27 -27 ACTIVITY Convert this sign and magnitude number to denary:

4 Activity Explain how to convert sign and magnitude numbers to denary.
Question Answer Explain how to convert sign and magnitude numbers to denary. The left most bit is the sign bit. 0 represents a positive number and 1 represents a negative number. This bit does not count in the actual process of adding up the binary number.

5 Activity 1100 1101 -(64+8+4+1) = -77 0001 1111 +(16+8+4+2+1) = +31
Sign and magnitude binary number Denary -( ) = -77 +( ) = +31 -(64+1) = -65 -( ) = -126 +( ) = +125 -( ) = -62 +( ) = +91

6 Convert this two’s complement binary number to denary: 11100011
Negative Numbers: Two’s Complement Two’s Complement is an alternative method of representing negative numbers. This method also works with binary addition. The most significant (the left most and largest number) bit is the minus number. -128 64 32 16 8 4 2 1 = -115 ACTIVITY Convert this two’s complement binary number to denary:

7 Activity Question Answer Explain how to convert two’s complement numbers into denary The left most bit (the largest bit) represents the negative value of the usual number. For example in an 8-bit number it would be -128 instead of 128. It is then added up as usual.

8 Activity 1100 1101 -128+64+8+4+1 = -51 0001 1111 16+8+4+2+1 = 31
Two’s complement binary number Denary = -51 = 31 = -118 = 92 -128 = -1 = 126

9 Negative Number Issues
The problem with sign and magnitude is that it does not always work when adding together numbers. 1 (+7) (-5) + (-12) Sign bit

10 Write these rules in your book and memorise them!
Binary Addition The process of performing addition in binary is similar to addition in denary The Rules 0+0 = o 1+0 or 0+1 = 1 1+1 = 0 carry 1 = 1 carry 1 Write these rules in your book and memorise them! 1 + 1 + 1 + 1

11 If you do not show your working out you will not get any marks
Activity Add these binary numbers, check your answer by converting them to denary. 1 + 1 + 1 + 1 + If you do not show your working out you will not get any marks 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +

12 Overflow Errors When there isn’t enough room for a result, this is called an overflow and it produces an overflow error 1 + Copy this example and explanation of an overflow error in your book ACTIVITY No room for a carry, so it is lost and we get the wrong answer Humans can easily work around this, but it isn’t so easy for a computer


Download ppt "GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers."

Similar presentations


Ads by Google