Lab Micro
Lab Micro
1
Objective:
Introduction to differentiate between binary, decimal and hexadecimal number system and
also convert number in one number system to another number system. A brief understanding of
assembly language and understands the difference between low-level and high-level languages.
Theory:
Most people today use decimal representation to count. In the decimal system there are 10
digits: 0, 1, 3, 4, 5, 6, 7, 8, and 9. These digits can represent any value, for example, 754. The value
is formed by the sum of each digit, multiplied by the base (in this it is 10 because there are 10
digits in decimal system) in power of digit position (counting from zero):
2
7 * 10 5*101 4*10 0 700 50 4 754
Position of each digit is very important! For example if you place “7” at the end value it
will become another value.
2
5* 10 4*101 7 *10 0 500 40 7 547
Important note: any number power of zero is 1; even zero in power of zero is 1.
100 00 x 0 1
Computers are not as smart as humans are (or not yet), it’s easy to make an electronic
machine with two states on and off, or 1 and 0. Computers use binary system, binary system uses
2 digits: 1, 1. and thus the base are 2. Each digit in a binary number is called a BIT, 4 bits form a
NIBBLE, 8 bits form a BYTE, two bytes form a WORD, and two words form a DOUBLE WORD
(rarely used).
There is a convention to add “b” in the end of a binary number, this way we can determine
that 101b is a binary number with decimal value of 5. This binary number 10100101b equals to
decimal value of 165:
10100101b
5
1* 27 0* 26 1* 2 0* 2 4 0* 23 1* 2 2 0* 21 1* 2 0
128 0 32 0 0 4 0 1
165(decimal _ value)
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Hexadecimal Value
1234
(binary numbers)
There is a convention to add “h” in the end of a hexadecimal number, this way we can determine
that 5Fh is a hexadecimal number with value of 95. We also add “0” (zero) in the beginning of
hexadecimal numbers that begin with a letter (A…F), for example 0E120h.
A utility program called assembler is used to translate assembly language statements into the
target computer’s machine code. The assembler performs a more or less isomorphic translation (a
one-to-one mapping) from mnemonic statements into machine instructions and data. This is in
contrast with high-level languages, in which a single statement generally results in many machine
instructions.
Assembly language is a low level programming language. You need to get some knowledge
about computer structure in order to understand anything.
(RAM)
(CPU)
Devices:
Conclusion: