Microprocessor Articles

Page 8 of 42

Signed floating point numbers

Arjun Thakur
Arjun Thakur
Updated on 27-Jun-2020 2K+ Views

Were present real numbers in our daily life is not convenient for representing very small numbers, like +0.00000012347650. This same number can be more conveniently represented in scientific notation as +1.23476× 10−07. But this actually stands for +0.000000123476. So there is an error of 0.00000000000005, which forms a very small percentage error.Floating-point representation is similar in concept to scientific notation. Logically, a floating-point number consists of:A signed (meaning positive or negative) digit string of a given length in a given base(or radix).This digit string is referred to as the significand, mantissa, or coefficient.A signed integer exponent which modifies the magnitude of ...

Read More

Data transfer group in 8051

Arjun Thakur
Arjun Thakur
Updated on 27-Jun-2020 14K+ Views

In 8051 Microcontroller there is 28 different instructions under the Data Transfer Group. In total there are 79 opcodes. The flags are not affected by using the data transfer instructions, but the P (Parity) flag may change if the value of A register is changed using Data Transfer Instruction. Similarly, when a data is transferred to the PSW register, the flags will change.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecution TimeOpcode CountMOV A, Rn118MOV A, a8211MOV A, @Ri112MOV A, #d8211MOV Rn, A118MOV Rn, a8228MOV Rn, ...

Read More

Arithmetic group in 8051

Ankith Reddy
Ankith Reddy
Updated on 27-Jun-2020 13K+ Views

In 8051 Microcontroller there are 24 different instructions under the Arithmetic Group. In total there are 64 opcodes. The Carry Flag (CY), Auxiliary Carry (AC)and Overflow flag (OV) are affected based on the result of ADD, ADDC, SUBB  etc. instructions. The multiple and divide instructions clear the Carry flag, and also does not affect the AC flag. After execution of multiplication, the OV flag will be 1 when the result is greater than FFH. Otherwise, it is 0. Similarly, after division OV flag is 1 when the content of B is 00H before division, otherwise it is 0. The DA ...

Read More

Unsigned binary integers

Ankith Reddy
Ankith Reddy
Updated on 27-Jun-2020 5K+ Views

Unsigned binary integers are numbers without any ‘+’or ‘-’ sign. Here all bits representing the number will represent the magnitude part of the number only. No bits will remain reserved for sign bit representation. An unsigned binary integer is a fixed-point system with no fractional digits.Some real life Examples are −Number of tables in a class, The number of a member of a family.Obviously, they are unsigned integers like 10 and 5. These numbers have to be represented in a computer using only binary notation or using bits.Numbers are represented in a computer using a fixed size, like 4, 8, ...

Read More

Sign Magnitude notation

George John
George John
Updated on 27-Jun-2020 12K+ Views

The sign-magnitude binary format is the simplest conceptual format. In this method of representing signed numbers, the most significant digit (MSD) takes on extra meaning.If the MSD is a 0, we can evaluate the number just as we would any normal unsigned integer. And also we shall treat the number as a positive one.If the MSD is a 1, this indicates that the number is negative.The other bits indicate the magnitude (absolute value) of the number. Some of the signed decimal numbers and their equivalent in SM notation follows assuming a word size of 4 bits.Signed decimalsign-magnitude     +6   0110    ...

Read More

Shift a multi-byte BCD number to the right in 8051

Ankith Reddy
Ankith Reddy
Updated on 27-Jun-2020 432 Views

Here we will see a problem to shift some multi-byte BCD number to the right. The BCD numbers are shifted by two digits (8-bit). Let us consider a four-byte BCD number (45 86 02 78) is stored at location 20H, 21H, 22H, 23H. The address 10H holds the number of bytes of the whole BCD number. So after executing this code, the contents will be shifted to the right and 20H will hold 00H.AddressValue...20H4521H8622H0223H78...Program        CLRA;Clear the Register A         MOVR2, 10H;TakeByte Count         INCR2;Increase R2 for loop         MOVR1, ...

Read More

Binary to BCD conversion in 8051

George John
George John
Updated on 27-Jun-2020 4K+ Views

In this problem, we will see how to convert an 8-bit binary number to its BCD equivalent. The binary number is stored at location 20H. After converting, the results will be stored at 30H and 31H. The 30H will hold the MS portion, and 31H will hold the LS portion. So let us assume the data is D5H. The program converts the binary value of D5H to BCD value 213D.AddressValue...20HD521H...ProgramMOVR1, #20H;Takethe address 20H into R1 MOVA, @R1;Takethe data into Acc MOVB, #0AH;LoadB with AH = 10D DIVAB ;DivideA with B MOVR5, B;Storethe remainder MOVB, #0AH;LoadB with AH = 10D DIVAB ;DivideA ...

Read More

BCD to binary conversion in 8051

Chandu yadav
Chandu yadav
Updated on 27-Jun-2020 4K+ Views

In this problem, we will see how to convert 8-bit BCD number to its Binary (Hexadecimal)equivalent. The BCD number is stored at location 20H. After converting, the results will be stored at 30H.So let us assume the data is D5H. The program converts the binary value ofD5H to BCD value 213D.AddressValue...20H9421H...Program   MOVR0, #20H; Initialize the address of the data    MOVA, @R0;Get the data from an address, which is stored in R0    MOVR2, A; Store the content of A into R2        CLRA;Clear the content of A to 00H    MOVR3, #00H LOOP:   ADDA, #01H;increment A ...

Read More

Hex to ASCII conversion in 8051

Arjun Thakur
Arjun Thakur
Updated on 27-Jun-2020 6K+ Views

Now we will see how to convert Hexadecimal number to its ASCII equivalent using 8051. This program can convert 0-9 and A-F to its ASCII value. We know that the ASCII of number 00H is 30H (48D), and ASCII of 09H is39H (57D). So all other numbers are in the range 30H to 39H. The ASCII value of 0AH is 41H (65D) and ASCII of 0FH is 46H (70D), so all other alphabets (B, C, D, E) are in the range 41H to 46H.Here we are providing hexadecimal digit at memory location 20H, The ASCII equivalent is storing at location 30H.AddressValue...20H0EH21H...ProgramMOVR0, ...

Read More

Bit manipulation program in 8051

Ankith Reddy
Ankith Reddy
Updated on 27-Jun-2020 6K+ Views

In this section, we will see some bit manipulation operation using 8051. The 8051 supports some operations on different bits of an 8-bit number. The operations are like complementing, setting to 1, moving, ANDing, ORing etc.In this example, we are taking a number AEH from location 10H, then after performing following bit related operations on that data, we are just storing the result at location 30H.The bit related operations that will be performed on that data, are as follows −Complement bit b2Move b5to b4OR b0and complement of b1 and store to C (b7)Set b6Reset bit b3Input is AEHBitPositionb7b6b5b4b3b2b1b0Value10101110OutputBitPositionb7b6b5b4b3b2b1b0Value01110010The output will be ...

Read More
Showing 71–80 of 417 articles
« Prev 1 6 7 8 9 10 42 Next »
Advertisements