0% found this document useful (0 votes)
103 views4 pages

Data Types Worksheet 3

This document provides examples and problems involving binary arithmetic using different data types including binary, two's complement binary, and fixed point binary. It includes carrying out binary additions and subtractions, converting between decimal and different binary representations, and describing issues that could occur with binary overflow.

Uploaded by

maish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views4 pages

Data Types Worksheet 3

This document provides examples and problems involving binary arithmetic using different data types including binary, two's complement binary, and fixed point binary. It includes carrying out binary additions and subtractions, converting between decimal and different binary representations, and describing issues that could occur with binary overflow.

Uploaded by

maish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Worksheet 3 Binary arithmetic

Data types

Task 1
Carry out the following binary sums showing your working out:

a) 1012 + 1112

1 0 1
1 1 1

b) 101102 + 101112

1 0 1 1 0
1 0 1 1 1

c) 112 + 1000012 +1012

1 1
1 0 0 0 0 1
1 0 1

d) 101012 + 1110112 + 10012

Show how the following values can be stored as binary bytes within a computer system and
determine the answer that would be calculated and stored:

e) 1210 + 1310

128 64 32 16 8 4 2 1

1
Worksheet 3 Binary arithmetic
Data types

f) 17410 + 25510

g) 1910 + 6610 + 7410

Answer the following question:

h) A computer has been designed to work only in single bytes of data. Describe the
problem that will be encountered when carrying out the sum 011110012 + 111110012 if
the answer is only allocated one byte of storage.

2
Worksheet 3 Binary arithmetic
Data types

Task 2 Binary subtraction


Convert these decimal values into two’s complement binary bytes:

a) -5010

b) -12010

c) 12710

d) -12810

e) Show that -5010 gives the same result as in (a) above using the following alternative
method:
Assume the left-most bit represents -128. Start at -128 and then add the remaining
values:
-128 64 32 16 8 4 2 1

Carry out the following calculations in two’s complement binary bytes:

f) -5010 -3010 or -5010 + -3010

1 1 0 0 1 1 1 0
1 1 1 0 0 0 1 0

g) -6610 + 3410

h) -8810 - 1210

i) 2210 - -1410

3
Worksheet 3 Binary arithmetic
Data types

Task 3 Fixed point binary


Convert these decimal values into a fixed-point binary byte where the first 4 bits represent the
whole number part and the the last 4 bits represent the fractional part:

a) 8.510

b) 14.2510

c) 0.12510

d) 5.562510

e) 1.937510

f) 0.062510

Convert these fixed-point binary bytes to decimal where the first 3 bits represent the whole
number part and the the last 5 bits represent the fractional part:

g) 101010102

h) 101110112

i) 001110112

j) 111110002

k) 000111112

l) 111111112

You might also like