Search Header Logo
H CS - Data Rep (Integers)

H CS - Data Rep (Integers)

Assessment

Presentation

Computers

3rd Grade

Practice Problem

Easy

Created by

G Alexander-Doyle

Used 4+ times

FREE Resource

12 Slides • 5 Questions

1

  • Computer Systems

    • Data representation

      • Integers

2

  • Describe and exemplify the use of binary to represent positive and negative integers using two’s complement, including the range of numbers that can be represented using a fixed number of bits.

  • Conversion of two’s complement numbers from binary to denary and vice versa.

​Learning intentions

3

Convert the number 22 into binary.

Binary recap (N5)

​128

64​

32​

16​

8​

4​

2​

1​

​0

0​

​0

​1

​0

1​

​1

​0

16 + 4 + 2 = 22

4

Fill in the Blanks

media image

Type answer...

5

Fill in the Blanks

media image

Type answer...

6

  • Binary is a simple two-state system (1 or 0) which is ideal when representing a two state system of power on/power off.

  • There are only a few rules for addition, making calculations simpler.

  • A degraded signal can still be detected as representing 1 or 0

Binary recap (N5) Advantages

7

Units of storage recap

media

8

Negative numbers

  • To represent a negative number the computer system must store the sign of the number;  (+) positive or (-) negative.

  • To represent the sign we use 1 to show a negative and a 0 to represent a positive.

  • To represent negative numbers we use a system called “Two’s Complement

9

Negative numbers

  • When using 8 bit Two’s Complement, the range of numbers that can be stored changes when compared to 8 bit storage of positive integers. This is because we include the negative numbers within the range.

  • The lowest value that can be represented with 8 bits is – 128 and the highest value is 127. This means the overall range is:

media

10

Negative numbers

The table below shows the ranges for varying number of bits, however they all follow the formula:

media
media

11

Negative numbers - denary to binary

Number to represent: -10

  1. Represent positive 10 in binary

  2. Change all the zeroes to ones and vice versa.

  3. Add 1

​128

​64

​32

​16

​8

​4

​2

​1

​0

0​

0​

0​

​1

0​

​1

0​

​1

​1

​1

​1

​0

1​

​0

1​

1​

1​

​1

1​

0​

1​

1​

0​

12

Negative numbers - binary to decimal

How can we switch from a two’s complement number back to denary? Take the following number as an example:

-​128

​64

​32

​16

​8

​4

​2

​1

1​

1​

​1

0

1

1​

1​

0​

  • The left-most bit is the sign bit. This has the value of -128.

  • Find the sum of the remaining bits 64+32+8+4+2 = 110

  • Subtract the sign bit from the sum of the remaining bits. 110 - (-28) = -18

13

Fill in the Blanks

Type answer...

14

Fill in the Blanks

Type answer...

15

Negative numbers - range

We can determine the range of negative and positive numbers which can be represented with two's complement by using the formula on the previous slide, or we can work it out.

What is the range of negative and positive numbers which can be represented with 6 bits? The lowest negative number will have a 1 placed under the sign bit and a 0 in every other column.

​-32

​16

​8

​4

​2

​1

​1

0

0

0

0

0​

-32

16

Negative numbers - range

The highest positive number will have a 0 placed under the sign bit and a 1 in every other column.

​-32

​16

​8

​4

​2

​1

​0

1

1

1

1

1

31

The range of negative and positive numbers which can be represented with 6 bits is -32 to 31.

17

Fill in the Blanks

Type answer...

  • Computer Systems

    • Data representation

      • Integers

Show answer

Auto Play

Slide 1 / 17

SLIDE