0% found this document useful (0 votes)
5 views16 pages

Mathematics For Computing

The document provides an overview of binary numbers, including their representation, conversion between binary and decimal for both whole and fractional numbers, and the concept of two's complement for representing negative integers. It includes examples and exercises for practice in converting between binary and decimal formats. Additionally, it explains the relationship between bits and bytes, detailing the hierarchy of data storage units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views16 pages

Mathematics For Computing

The document provides an overview of binary numbers, including their representation, conversion between binary and decimal for both whole and fractional numbers, and the concept of two's complement for representing negative integers. It includes examples and exercises for practice in converting between binary and decimal formats. Additionally, it explains the relationship between bits and bytes, detailing the hierarchy of data storage units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Mathematics for

Computing
Dr. M H B Ariyaratne
Binary Numbers

 Bi means two


Made up of
Base 2 values
0 1
s and s

 Ex = 101 (one-oh-one/one-zero-one)
 How to show - 1012

Reference
Binary Numbers (Mixed Numbers)

Example: 10.1

The "10" means 2 in decimal,

The ".1" means half,

So "10.1" in binary is 2.5 in decimal


Bit

 bit = “Binary Digit”


 Single Binary Digit -> bit
 Ex, 10010 is 5 bits long
Bytes

· 1 Bit = Binary Digit

· 8 Bits = 1 Byte

· 1024 Bytes = 1 Kilobyte

· 1024 Kilobytes = 1 Megabyte

· 1024 Megabytes = 1 Gigabyte

· 1024 Gigabytes = 1 Terabyte

· 1024 Terabytes = 1 Petabyte

· 1024 Petabytes = 1 Exabyte

· 1024 Exabytes = 1 Zettabyte


Binary to Decimal (Whole Numbers)
Exercise D1E1

Convert binary to decimal values

Example (10011)2 = (19)10

1. 1001011
2. 110101
3. 10001011
4. 01000000
5. 00111111
Decimal to Binary (Whole Numbers)
Exercise D2E2

Convert decimal to binary values

Example (19)10 = (10011)2

1. 63
2. 33
3. 100
4. 120
5. 168
Decimal to Binary (Fraction Numbers)
Exercise D2E3

Convert decimal to binary values

Example (0.435)10 = (0.01101)2

1. 0.63
2. 0.435
3. 4.1
4. 8.64
5. 2.531
Binary to Decimal (Fraction Numbers)
Exercise D2E4

Convert binary to decimal values

Example (0.10010)2 = (0.5625)10

1. 0.1
2. 0.1001
3. 0.111
4. 1.001
5. 11.11
Two's Complement

 The way computers represent integers


 Common math problems are very simple to implement
 Ex. (nibble or ½ byte)
 0000 - Zero
 0001 - one
 1111 - minus one
 To get the two's complement negative notation of an integer
 write out the number in binary
 Then invert the digits
 Add one to the result
 Ex. find how -28 would be expressed in two's complement notation > write out 28 in
binary form -> 00011100 > Then invert the digits. 0 becomes 1, 1 becomes 0. ->
11100011 >Then we add 1 -> 11100100 Reference
Two’s Complement
Thank you

You might also like