intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Binary Converting to and from decimal

Chia sẻ: Cao Van Manh | Ngày: | Loại File: PDF | Số trang:27

51
lượt xem
5
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

We normally use the decimal (denary). system, also called base 10. l There are 10 different symbols .(digits). l 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 l To count higher than nine we re-use the symbols by putting them in columns. l The value of aComputers use the binary system, also called base 2 l There are two different symbols (digits) l 0, 1 l To count higher than one we re-use the symbols by putting them in columns l The value of a symbol depends on its position symbol depends on its position....

Chủ đề:
Lưu

Nội dung Text: Binary Converting to and from decimal

  1. Binary Converting to and from decimal 3-Dec-09 quangkien@gmail.com 1 1
  2. Decimal l We normally use the decimal (denary) system, also called base 10 l There are 10 different symbols (digits) l 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 l To count higher than nine we re-use the symbols by putting them in columns l The value of a symbol depends on its position 3-Dec-09 quangkien@gmail.com 2 2
  3. Decimal positions 1000 100 10 1 Thousands Hundreds Tens Units 8 2 5 3 Eight thousand two hundred and fifty three 3-Dec-09 quangkien@gmail.com 3 3
  4. Binary l Computers use the binary system, also called base 2 l There are two different symbols (digits) l 0, 1 l To count higher than one we re-use the symbols by putting them in columns l The value of a symbol depends on its position 3-Dec-09 quangkien@gmail.com 4 4
  5. Binary positions 8 4 2 1 Eights Fours Twos Units 1 1 0 1 One eight, one four, no twos and one unit That makes thirteen 3-Dec-09 quangkien@gmail.com 5 5
  6. Counting in binary and decimal 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 15 3-Dec-09 quangkien@gmail.com 6 6
  7. Why do computers use binary? l Computer components that store or handle data are often two-state devices l This is like a switch that can be on or off l A memory unit could exist in two voltage states, high or low l A voltage on a cable could be high or low l A light could be on or off l Two states can be coded by binary 0 and 1 3-Dec-09 quangkien@gmail.com 7 7
  8. Why am I learning about binary? l In your Cisco course, you will learn about IP addresses and how to split up a network into subnets l You need to work out subnet addresses and workstation addresses l For this you need to use binary 3-Dec-09 quangkien@gmail.com 8 8
  9. Bytes or octets l We often handle binary digits (bits) in groups of eight l Sometimes these groups are called bytes l Sometimes they are called octets l We shall often be calling them octets l Examples of octets: 00101101 10110010 3-Dec-09 quangkien@gmail.com 9 9
  10. Convert binary to decimal Value 128 64 32 16 8 4 2 1 Binary Convert 11001010 binary to decimal Write in the binary digits under their values 3-Dec-09 quangkien@gmail.com 10 10
  11. Convert binary to decimal Value 128 64 32 16 8 4 2 1 Binary 1 1 0 0 1 0 1 0 Convert 11001010 binary to decimal Write in the binary digits under their values Next write in the value for each binary 1 digit 3-Dec-09 quangkien@gmail.com 11 11
  12. Convert binary to decimal Value 128 64 32 16 8 4 2 1 Binary 1 1 0 0 1 0 1 0 128 64 8 2 Convert 11001010 binary to decimal Write in the binary digits under their values Next write in the value for each binary 1 digit Add up the values 128 + 64 + 8 + 2 = 202 3-Dec-09 quangkien@gmail.com 12 12
  13. One for you to try l Convert 10010101 from binary (base 2) to decimal (base 10) Value 128 64 32 16 8 4 2 1 Binary 3-Dec-09 quangkien@gmail.com 13 13
  14. Answer l Convert 10010101 from binary (base 2) to decimal (base 10) Value 128 64 32 16 8 4 2 1 Binary 1 0 0 1 0 1 0 1 128 16 4 1 128 + 16 + 4 + 1 = 149 3-Dec-09 quangkien@gmail.com 14 14
  15. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary Check Convert 185 decimal to binary Can you take 128 from 185? Yes. Put 1 under 128 What is left? 185-128 = 57 3-Dec-09 quangkien@gmail.com 15 15
  16. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary 1 Check We have 57 left Can you take 64 from 57? No. Put 0 under 64 What is left? Still 57 3-Dec-09 quangkien@gmail.com 16 16
  17. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary 1 0 Check We have 57 left Can you take 32 from 57? Yes. Put 1 under 32 What is left? 57 – 32 = 25 3-Dec-09 quangkien@gmail.com 17 17
  18. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary 1 0 1 Check We have 25 left Can you take 16 from 25? Yes. Put 1 under 16 What is left? 25 – 16 = 9 3-Dec-09 quangkien@gmail.com 18 18
  19. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary 1 0 1 1 Check We have 9 left Can you take 8 from 9? Yes. Put 1 under 8 What is left? 9 – 8 = 1 3-Dec-09 quangkien@gmail.com 19 19
  20. Convert 185 decimal to binary Value 128 64 32 16 8 4 2 1 Binary 1 0 1 1 1 Check Wwe have 1 left Can you take 4 from 1? No. Put 0 under 4 What is left? Still 1 3-Dec-09 quangkien@gmail.com 20 20
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2