Binar Operations(4)

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 17

Week 13

• Mrs. Glenda Dalipe


Mathematics as a Tool
Binary Codes
• Attendance
Quick Overview of Last week’s lesson

Perhaps the most common use for binary nowadays is in


computers: binary code is the way that most
computers and computerized devices ultimately
send, receive, and store information.

Binary to Decimal (base 2 to base 10)

1011
Base 10

Note: any number with an exponent of zero is 1


Base 2 (binary)
Binary (base 2) representation

• The binary representation contains two symbols: { 0, 1 }


• Position of each symbol represents a power of two

• What is the value of the binary representation 111?

1 1 1
  
position: 2 1 0

111 = 122 + 121 +


120
= 14 + 12 + 11
Binary to Decimal
• What is the value of the binary representation 1010?

1 0 1 0
   
position: 3 2 1 0

1010 = 123 + 022 + 121 + 020


= 18 + 04 + 12 + 01
= 8 + 0 + 2 + 0 = 10
Converting decimal to binary

0 remainder 1
• Repeated division by 21
two until the quotient
is zero 1 remainder 1
2 3
• What is the binary
representation of 30? 3 remainder 1
2 7
7 remainder 1
2 15
15 remainder 0
2 30

11110
Converting decimal to binary
0 remainder 1
• Repeated division by 21
two until the quotient 1 remainder 0
is zero 2 2
• What is the binary 2 remainder 1
representation of 47? 2 5
5 remainder 1
2 11
11 remainder 1
2 23
23 remainder 1
2 47
101111
Binary addition

0 1 0 1
+ 0 + 0 + 1 + 1
------- ------- ------- -------
0 1 1 10

• Represent sum of binary numbers as a binary number


decimal addition binary addition
1+1 = 2 1+1 = 10
1+1+1 = 3 1+1+1 =
10+1 = 11
Adding binary numbers

11  carry 11  carry
101 101 111
+ 10 + 11 + 110
--------- ----------- -----------
111 1000 1101

1 11  carry
10101010111
+ 110000110
------------------------
11011011101
Problems

• Convert 1011000 to decimal representation

• Add the binary numbers 1011001 and 10101 and


express their sum in binary representation

• Convert 77 to binary representation


Solutions

• Convert 1011000 to decimal representation

1011000 = 126 + 025 + 124 + 123 + 022 + 021 + 020


= 64 + 16 + 8 = 88

• Add the binary numbers 1011001 1011001


and 10101 and express their sum + 10101
in binary representation
----------------
1101110

• Convert 77 to binary representation: 1001101


• Special Exam

• Nov 22 1:00-3:00 pm
s

You might also like