Name:
Section:
1. Binary Number System
2. Decimal Number System
3. Octal Number System
4. Hexadecimal Number System
Name:Ranier G. Cordero
Section:HN3
1. Binary Number System
2. Decimal Number System
The decimal numeral system (also called base ten or occasionally denary) has ten as its base. It is the numerical base most widely used by modern civilizations.
Decimal notation often refers to a base-10 positional notation such as the Hindu-Arabic numeral system; however, it can also be used more generally to refer to non-positional systems such as Roman or Chinese numerals which are also based on powers of ten.
Decimals also refer to decimal fractions, either separately or in contrast to vulgar fractions. In this context, a decimal is a tenth part, and decimals become a series of nested tenths. There was a notation in use like 'tenth-metre', meaning the tenth decimal of the metre, currently an Angstrom. The contrast here is between decimals and vulgar fractions, and decimal divisions and other divisions of measures, like the inch. It is possible to follow a decimal expansion with a vulgar fraction; this is done with the recent divisions of the troy ounce, which has three places of decimals, followed by a trinary place.
3. Octal Number System
The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right). For example, the binary representation for decimal 74 is 1001010, which can be grouped into (00)1 001 010 – so the octal representation is 112.
In decimal systems each decimal place is a base of 10. For example:

In octal numerals each place is a power with base 8. For example:

By performing the calculation above in the familiar decimal system we see why 112 in octal is equal to 64+8+2 = 74 in decimal.
Octal is sometimes used in computing instead of hexadecimal.
4. Hexadecimal Number System
In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.
Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. One hexadecimal digit represents a nibble, which is half of an octet (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. Hexadecimal is also commonly used to represent computer memory addresses.
Name: REY VINCENT MESAJON
Section: HN3
1. Binary Number System
To understand binary numbers, begin by recalling elementary school math. When we first learned about numbers, we were taught that, in the decimal system, things are organized into columns:
H | T | O
1 | 9 | 3
such that "H" is the hundreds column, "T" is the tens column, and "O" is
the ones column. So the number "193" is 1-hundreds plus 9-tens plus
3-ones.
Years later, we learned that the ones column meant 10^0, the tens column meant 10^1, the hundreds column 10^2 and so on, such that
10^2|10^1|10^0
1 | 9 | 3
the number 193 is really {(1*10^2)+(9*10^1)+(3*10^0)}.
As you know, the decimal system uses the digits 0-9 to represent numbers. If we wanted to put a larger number in column 10^n (e.g., 10), we would have to multiply 10*10^n, which would give 10^(n+1), and be carried a column to the left. For example, putting ten in the 10^0 column is impossible, so we put a 1 in the 10^1 column, and a 0 in the 10^0 column, thus using two columns. Twelve would be 12*10^0, or 10^0(10+2), or 10^1+2*10^0, which also uses an additional column to the left (12).
The binary system works under the exact same principles as the decimal system, only it operates in base 2 rather than base 10. In other words, instead of columns being
10^2|10^1|10^0
they are
2^2|2^1|2^0
Instead of using the digits 0-9, we only use 0-1 (again, if we used anything larger it would be like multiplying 2*2^n and getting 2^n+1, which would not fit in the 2^n column. Therefore, it would shift you one column to the left. For example, "3" in binary cannot be put into one column. The first column we fill is the right-most column, which is 2^0, or 1. Since 3>1, we need to use an extra column to the left, and indicate it as "11" in binary (1*2^1) + (1*2^0).
Examples:
What would the binary number 1011 be in decimal notation?
Click here to see the answer
Try converting these numbers from binary to decimal:
Remember: 2^4| 2^3| 2^2| 2^1| 2^0
| | | 1 | 0
| | 1 | 1 | 1
1 | 0 | 1 | 0 | 1
1 | 1 | 1 | 1 | 0
2. Decimal Number System
Probably the biggest stumbling block most beginning programmers encounter when attempting to learn assembly language is the common use of the binary and hexadecimal numbering systems. Understanding these numbering systems is important because their use simplifies other complex topics including boolean algebra and logic design, signed numeric representation, character codes, and packed data.
This section discusses several important concepts including the binary, decimal, and hexadecimal numbering systems, binary data organization (into bits, nibbles, bytes, words, and double words), signed and unsigned number systems, arithmetic, logical, shift, and rotate operations on binary values, bit fields and packed BCD (Binary Coded Decimal) data, and the ASCII (American Standard Code for Information Interchange) character set. This is basic material and the remainder of this tutorial depends upon your understanding of these concepts. If you are already familiar with these terms from other courses or study, you should at least skim this material before proceeding to the next chapter. If you are unfamiliar with this material, or only vaguely familiar with it, you should study it carefully before proceeding. All of the material in this chapter is important! Do not skip over any material.
Most modern computer systems do not represent numeric values using the decimal system. Instead, they typically use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers.
Remember how mathematical operations are entered into a computer:
You have been using the decimal (base 10) numbering system for so long that you often take it for granted. When you see a number like "123", you don't think about the value 123. Instead, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents:
1 * 10^2 + 2 * 10^1 + 3 * 10^0 =
1 * 100 + 2 * 10 + 3 * 1 =
100 + 20 + 3 =
123
Each digit appearing to the left of the decimal point represents a value between zero and nine times power of ten represented by its position in the number. Digits appearing to the right of the decimal point represent a value between zero and nine times an increasing negative power of ten. For example, the value 725.194 is represented as follows:
7 * 10^2 + 2 * 10^1 + 5 * 10^0 + 1 * 10^-1 + 9 * 10^-2 + 4 * 10^-3 =
7 * 100 + 2 * 10 + 5 * 1 + 1 * 0.1 + 9 * 0.01 + 4 * 0.001 =
700 + 20 + 5 + 0.1 + 0.09 + 0.004 =
725.194
3. Octal Number System
4. Hexadecimal Number System
The decimal version requires only three decimal digits and, thus, represents numbers much more compactly than does the binary numbering system. This fact was not lost on the engineers who designed binary computer systems.
When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:
The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and place an "h" at the end of the number to denote the number base. In PICBASIC, we simply put a "$" at the left end of the number.
The Hexadecimal Number System:
|
In the Hexadecimal number system, the hex values greater than 9 carry the following decimal value:
| Binary | Decimal | Hex |
| %0000 | 0 | $0 |
| %0001 | 1 | $1 |
| %0010 | 2 | $2 |
| %0011 | 3 | $3 |
| %0100 | 4 | $4 |
| %0101 | 5 | $5 |
| %0110 | 6 | $6 |
| %0111 | 7 | $7 |
| %1000 | 8 | $8 |
| %1001 | 9 | $9 |
| %1010 | 10 | $A |
| %1011 | 11 | $B |
| %1100 | 12 | $C |
| %1101 | 13 | $D |
| %1110 | 14 | $E |
| %1111 | 15 | $F |
This table provides all the information you'll ever need to convert from one number base into any other number base for the decimal values from 0 to 16.
To convert a hexadecimal number into a binary number, simply break the binary number into 4-bit groups beginning with the LSB and substitute the corresponding four bits in binary for each hexadecimal digit in the number.
For example, to convert $ABCD into a binary value, simply convert each hexadecimal digit according to the table above. The binary equivalent is:
| $ABCD | = | 1010 1011 1100 1101 |
To convert a binary number into hexadecimal format is almost as easy. The first step is to pad the binary number with leading zeros to make sure that the the binary number contains multiples of four bits. For example, given the binary number 1011001010, the first step would be to add two bits in the MSB position so that it contains 12 bits. The revised binary value is 001011001010.
The next step is to separate the binary value into groups of four bits, e.g., 0010 1100 1010. Finally, look up these binary values in the table above and substitute the appropriate hexadecimal digits, e.g., %0010=$2, %1100=$C, %1010=$A. %001011001010=$2CA.
The weighted values for each position is as follows:
| 163 | 162 | 161 | 160 |
| 4096 | 256 | 16 | 1 |
Name:April John Tayabas
Section:HA3
1. Binary Number System
2. Decimal Number System
3. Octal Number System
Octal Number System (Base-8)4. Hexadecimal Number System
Name:Charito B. Soliano
Section:HN3
1. Binary Number System
2. Decimal Number System
OCTAL NUMBER SYSTEM
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.
look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
4.Hexadecimal Number system
Name:Jennyfe s.Ronquillo
Section:HA3
1. Binary Number System
2. Decimal Number System
3.Octal Number System
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.
A big problem with the binary system is verbosity. To represent the value 202 requires eight binary digits.Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
4. Hexadecimal Number System
The decimal version requires only three decimal digits and, thus, represents numbers much more compactly than does the binary numbering system. This fact was not lost on the engineers who designed binary computer systems.
When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:
The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and place an "h" at the end of the number to denote the number base. In PICBASIC, we simply put a "$" at the left end of the number.
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
Name: JUVY MALABAR
Section: HA3
1. Binary Number System
Name: Charles Fernan Flordelis
Section: HN3
1. Binary Number System
2. Decimal Number System
3. Octal Number System
4. Hexadecimal Number System
Name:Mark Jaime G.Ramos
Section:HN3
1. Binary Number System
Name:Mark Jaime G. Ramos
Section:HN3
1. Binary Number System
2. Decimal Number System
3. Octal Number System
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.
Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
4. Hexadecimal Number System
NAME: LOVELY JANE KAMDANSection: HA3
Name: Charles Fernan Flordelis
Section: HN3
1. Binary Number System
2. Decimal Number System
Probably the biggest stumbling block most beginning programmers encounter when attempting to learn assembly language is the common use of the binary and hexadecimal numbering systems. Understanding these numbering systems is important because their use simplifies other complex topics including boolean algebra and logic design, signed numeric representation, character codes, and packed data.
This section discusses several important concepts including the binary, decimal, and hexadecimal numbering systems, binary data organization (into bits, nibbles, bytes, words, and double words), signed and unsigned number systems, arithmetic, logical, shift, and rotate operations on binary values, bit fields and packed BCD (Binary Coded Decimal) data, and the ASCII (American Standard Code for Information Interchange) character set. This is basic material and the remainder of this tutorial depends upon your understanding of these concepts. If you are already familiar with these terms from other courses or study, you should at least skim this material before proceeding to the next chapter. If you are unfamiliar with this material, or only vaguely familiar with it, you should study it carefully before proceeding. All of the material in this chapter is important! Do not skip over any material.
Most modern computer systems do not represent numeric values using the decimal system. Instead, they typically use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers.
Remember how mathematical operations are entered into a computer:
There are four number bases commonly used in programming. These are:
| Name | Base | Symbol |
| Binary | Base 2 | B |
| Octal | Base 8 | Q or O |
| Decimal | Base 10 | none or D |
| Hexadecimal | Base 16 | H |
The Decimal Number System uses base 10. It includes the digits from 0 through 9. The weighted values for each position is as follows:
| 10^4 | 10^3 | 10^2 | 10^1 | 10^0 | 10^-1 | 10^-2 | 10^-3 |
| 10000 | 1000 | 100 | 10 | 1 | .1 | .01 | .001 |
You have been using the decimal (base 10) numbering system for so long that you often take it for granted. When you see a number like "123", you don't think about the value 123. Instead, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents:
1 * 10^2 + 2 * 10^1 + 3 * 10^0 =
1 * 100 + 2 * 10 + 3 * 1 =
100 + 20 + 3 =
123
Each digit appearing to the left of the decimal point represents a value between zero and nine times power of ten represented by its position in the number. Digits appearing to the right of the decimal point represent a value between zero and nine times an increasing negative power of ten. For example, the value 725.194 is represented as follows:
7 * 10^2 + 2 * 10^1 + 5 * 10^0 + 1 * 10^-1 + 9 * 10^-2 + 4 * 10^-3 =
7 * 100 + 2 * 10 + 5 * 1 + 1 * 0.1 + 9 * 0.01 + 4 * 0.001 =
700 + 20 + 5 + 0.1 + 0.09 + 0.004 =
725.194
Sources: Various books, the Internet, and various encyclopedias.
Kilder: Forskellige bøger, internettet og forskellige leksikoner.
3. Octal Number System
OCTAL NUMBER SYSTEM
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.
Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
Table 1-3. - Binary and Octal Comparison
Unit and Number
The terms that you learned in the decimal and binary sections are also used with the octal system.
The unit remains a single object, and the number is still a symbol used to represent one or more units.
Base (Radix)
As with the other systems, the radix, or base, is the number of symbols used in the system. The octal system uses eight symbols - 0 through 7. The base, or radix, is indicated by the subscript 8.
Positional Notation
The octal number system is a positional notation number system. Just as the decimal system uses powers of 10 and the binary system uses powers of 2, the octal system uses power of 8 to determine the value of a number's position. The following bar graph shows the positions and the power of the base:
Remember, that the power, or exponent, indicates the number of times the base is multiplied by itself. The value of this multiplication is expressed in base 10 as shown below:
All numbers to the left of the radix point are whole numbers, and those to the right are fractional numbers.
MSD and LSD
When determining the most and least significant digits in an octal number, use the same rules that you used with the other number systems. The digit farthest to the left of the radix point is the MSD, and the one farthest right of the radix point is the LSD.
Example:
If the number is a whole number, the MSD is the nonzero digit farthest to the left of the radix point and the LSD is the digit immediately to the left of the radix point. Conversely, if the number is a fraction only, the nonzero digit closest to the radix point is the MSD and the LSD is the nonzero digit farthest to the right of the radix point.
Addition of Octal Numbers
The addition of octal numbers is not difficult provided you remember that anytime the sum of two digits exceeds 7, a carry is produced. Compare the two examples shown below:
The octal addition table in table 1-4 will be of benefit to you until you are accustomed to adding octal numbers. To use the table, simply follow the directions used in this example:
Add: 68 and 58
Table 1-4. - Octal Addition Table
Locate the 6 in the X column of the figure. Next locate the 5 in the Y column. The point in area Z where these two columns intersect is the sum. Therefore,
If you use the concepts of addition you have already learned, you are ready to add octal numbers.
Work through the solutions to the following problems:
As was mentioned earlier in this section, each time the sum of a column of numbers exceeds 7, a carry is produced. More than one carry may be produced if there are three or more numbers to be added, as in this example:
The sum of the augend and the first addend is 68 with a carry. The sum of 68 and the second addend is 58 with a carry. You should write down the 58 and add the two carries and bring them down to the sum, as shown below:
Now let's try some practice problems:
Q.24 Add:
Q.25 Add:
Q.26 Add:
Q.27 Add:
Q.28 Add:
Q.29 Add:
4. Hexadecimal Number System
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
Name: JUVY MALABAR
Section: HA3
1. Binary Number System
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
Name:JUVY MALABAR
Section:HA3
1. Binary Number System
Name:Jessie James Claro
Section:HN3
1. Binary Number System
2. Decimal Number System
3. Octal Number System
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers. |
Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
Table 1-3. - Binary and Octal Comparison |
Name:Sherwin
Section:Noquil
1. Binary Number System
2. Decimal Number System
3. Octal Number System
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.
Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
4. Hexadecimal Number System
The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers. Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:
Table 1-3. - Binary and Octal Comparison |
- itago ang nakapaniping teksto - |