Binary Converting to and from decimal
Thông tin tài liệu:
Nội dung trích xuất từ tài liệu:
Binary Converting to and from decimal Binary Converting to and from decimal3-Dec-09 quangkien@gmail.com 1 1Decimall We normally use the decimal (denary) system, also called base 10l There are 10 different symbols (digits)l 0, 1, 2, 3, 4, 5, 6, 7, 8, 9l To count higher than nine we re-use the symbols by putting them in columnsl The value of a symbol depends on its position 3-Dec-09 quangkien@gmail.com 2 2Decimal positions 1000 100 10 1Thousands Hundreds Tens Units 8 2 5 3Eight thousand two hundred and fifty three 3-Dec-09 quangkien@gmail.com 3 3Binaryl Computers use the binary system, also called base 2l There are two different symbols (digits)l 0, 1l To count higher than one we re-use the symbols by putting them in columnsl The value of a symbol depends on its position 3-Dec-09 quangkien@gmail.com 4 4Binary positions 8 4 2 1 Eights Fours Twos Units 1 1 0 1One eight, one four, no twos and one unitThat makes thirteen 3-Dec-09 quangkien@gmail.com 5 5Counting in binary anddecimal 0 0 1000 8 1 1 1001 9 10 2 1010 10 11 3 1011 11 100 4 1100 12 101 5 1101 13 110 6 1110 14 111 7 1111 153-Dec-09 quangkien@gmail.com 6 6Why do computers usebinary?l Computer components that store or handle data are often two-state devicesl This is like a switch that can be on or offl A memory unit could exist in two voltage states, high or lowl A voltage on a cable could be high or lowl A light could be on or offl Two states can be coded by binary 0 and 1 3-Dec-09 quangkien@gmail.com 7 7Why am I learning aboutbinary?l In your Cisco course, you will learn about IP addresses and how to split up a network into subnetsl You need to work out subnet addresses and workstation addressesl For this you need to use binary 3-Dec-09 quangkien@gmail.com 8 8Bytes or octetsl We often handle binary digits (bits) in groups of eightl Sometimes these groups are called bytesl Sometimes they are called octetsl We shall often be calling them octetsl Examples of octets: 00101101 10110010 3-Dec-09 quangkien@gmail.com 9 9Convert binary to decimalValue 128 64 32 16 8 4 2 1BinaryConvert 11001010 binary to decimalWrite in the binary digits under their values 3-Dec-09 quangkien@gmail.com 10 10Convert binary to decimalValue 128 64 32 16 8 4 2 1Binary 1 1 0 0 1 0 1 0Convert 11001010 binary to decimalWrite in the binary digits under their valuesNext write in the value for each binary 1 digit 3-Dec-09 quangkien@gmail.com 11 11Convert binary to decimalValue 128 64 32 16 8 4 2 1Binary 1 1 0 0 1 0 1 0 128 64 8 2Convert 11001010 binary to decimalWrite in the binary digits under their valuesNext write in the value for each binary 1 digitAdd up the values 128 + 64 + 8 + 2 = 202 3-Dec-09 quangkien@gmail.com 12 12One for you to tryl Convert 10010101 from binary (base 2) to decimal (base 10)Value 128 64 32 16 8 4 2 1Binary 3-Dec-09 quangkien@gmail.com 13 13Answerl Convert 10010101 from binary (base 2) to decimal (base 10)Value 128 64 32 16 8 4 2 1Binary 1 0 0 1 0 1 0 1 128 16 4 1128 + 16 + 4 + 1 = 149 3-Dec-09 quangkien@gmail.com 14 14Convert 185 decimal to binaryValue 128 64 32 16 8 4 2 1BinaryCheckConvert 185 decimal to binaryCan you take 128 from 185? Yes.Put 1 under 128What is left? 185-128 = 57 3-Dec-09 quangkien@gmail.com 15 15Convert 185 decimal to binaryValue 128 64 32 16 8 4 2 1Binary 1CheckWe have 57 leftCan you take 64 from 57? No.Put 0 under 64What is left? Still 57 3-Dec-09 quangkien@gmail.com 16 16Convert 185 decimal to binaryValue 128 64 32 16 8 4 2 1Binary 1 0CheckWe have 57 leftCan you take 32 from 57? Yes.Put 1 under 32What is left? 57 – 32 = 25 3-Dec-09 quangkien@gmail.com 17 17Convert 185 decimal to binaryValue 128 64 32 16 8 4 2 1Binary 1 0 1CheckWe have 25 leftCan you take 16 from 25? Yes.Put 1 under 16What is left? 25 – 16 = 9 3-Dec-09 quangkien@gmail.com 18 18Convert 185 decimal to binaryValue 128 64 32 16 8 ...
Tìm kiếm theo từ khóa liên quan:
Computer Science Engineering Computer Data Structures Definition of Stack Specifications for Stack Implementations of Stack Linked StackGợi ý tài liệu liên quan:
-
11 trang 141 0 0
-
Ebook Facts on file science experiments: Computer science experiments – Part 1
92 trang 69 0 0 -
Lecture Computer Architecture: Introduction
9 trang 45 0 0 -
Lecture Introduction to computing - Lecture 21
40 trang 35 0 0 -
Lecture Introduction to computing - Lecture 29
77 trang 35 0 0 -
computer science - an overview (12th edition): part 1
331 trang 35 0 0 -
Lecture Computer literacy - Lecture 03: Computer software
35 trang 34 0 0 -
Lecture Computer literacy - Lecture 27: Online Collaboration Applications
40 trang 34 0 0 -
Ebook Eloquent JavaScript - A modern introduction to programming: Part 1
199 trang 33 0 0 -
Lecture Introduction to computing - Lecture 13
50 trang 31 0 0 -
Ebok Mathematical foundation of computer science: Part 2
210 trang 31 0 0 -
Ebook Computer science - An overview
641 trang 31 0 0 -
Lecture Introduction to computing systems (2/e): Chapter 19 - Yale N. Patt, Sanjay J. Patel
28 trang 30 0 0 -
214 trang 29 0 0
-
computer science (9th edition): part 1
267 trang 29 0 0 -
Lecture Introduction to computing - Lecture 28
71 trang 29 0 0 -
Lecture Introduction to computing - Lecture 23
57 trang 29 0 0 -
Lecture Introduction to computing - Lecture 2
58 trang 28 0 0 -
Lecture Introduction to computing - Lecture 12
73 trang 28 0 0 -
Lecture Computer literacy - Lecture 22: Multimedia - Microsoft Power Point
24 trang 28 0 0