Dale - Computer Science Illuminated 68

Dale - Computer Science Illuminated 68 - 2.2 Natural...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
2.2 Natural Numbers 41 To convert from binary to octal, you start at the rightmost binary digit and mark the digits in groups of threes. Then you convert each group of three to its octal value. 111 101 100 754 Let’s convert the binary number 1010110 to octal, and then convert that octal value to decimal. The answer should be the equivalent of 1010110 in decimal, or 86. 1 010 110 12 6 1*8 2 =1*6 4=6 4 +2*8 1 =2* 8 ±=1 6 +6*8 0 =6* 1= 6 86 The reason that binary can be immediately converted to octal and octal to binary is that 8 is a power of 2. There is a similar relationship between binary and hexadecimal. Every hexadecimal digit can be represented in four binary digits. Let’s take the binary number 1010110 and convert it to hexadecimal by marking of the digits from right to left in groups of four.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online