Question

In: Computer Science

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity...

Convert decimal 3,712 and 4,132 to both BCD and ASCII codes. For ASCII, an even parity bit is to be apppended at the left.

Solutions

Expert Solution

(1)

(i) 371210

310 = 0011BCD

710 = 0111BCD

110 = 0001BCD

210 = 0010BCD

Therefore, 3712 in BCD = 0011 0111 0001 0010

(ii)

ASCII Value Hex Decimal Decimal Binary ASCII CODE (even parity)
3 33 3x161+3x160 = 51 0110011 0 0110011
7 37 3x161+7x160 = 55 0110111 1 0110111
1 31 3x161+1x160 = 49 0110001 1 0110001
2 32 3x161+2x160 = 50 0110010 1 0110010

Therefore, ASCII Code: 00110011  10110111  10110001  10110010

Note: Bold bits are parity bits.

Method 2: (Shortcut)

To convert to ASCII

Step 1: Add 48 to given character

3 + 48 = 51

7 + 48 = 55

1 + 48 = 49

2 + 48 = 50

step 2: Now convert obtained decimal numbers to binary

51 = 01100112

55 = 01101112

49 = 01100012

50 = 01100102

Step 3:

Even parity means total number 1's should be even. If a number contains odd 1's append 1 to it's left to make it even.

If it contains odd 1's append 0 to it's left.

ASCII code: 00110011  10110111  10110001  10110010

2)

(i) 413210

410 = 0100

110 = 0001

310 = 0011

210 = 0010

BCD :  0100 0001 0011 0010

(ii)

ASCII Value Hex Decimal Decimal Binary ASCII CODE (even parity)
4 34 3x161+4x160 = 52 0110100 1 0110100
1 31 3x161+1x160 = 49 0110001 1 0110001
3 33 3x161+3x160 = 51 0110011 0 0110011
2 32 3x161+2x160 = 50 0110010 1 0110010

ASCII Code of 4132 is : 10110100  10110001  00110011  10110010


Related Solutions

Add the following BCD numbers, and convert the obtained BCD result into the corresponding decimal, and...
Add the following BCD numbers, and convert the obtained BCD result into the corresponding decimal, and then convert the decimal result into the corresponding binary, then compare the number of bits required for binary with that required for BCD. (1) 0111 + 0101 (2) 1001 + 0111 (3) 01010001 + 01011000 (4) 010101100001 + 011100001000
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
Write a parity checker for the ASCII system in MARIE. MARIE is an assembly language. The...
Write a parity checker for the ASCII system in MARIE. MARIE is an assembly language. The parity checker should repeatedly execute a loop that performs the following tasks: 1. Ask the user for an input X, which can be any printable ASCII character from Table 1; 2. Output the decimal code of X; 3. Output the total number of 1’s that appears in the binary code of X; 4. Output the parity bit which, when added to the binary code...
36) Construct BCD counter and draw block diagram of a three-decade decimal BCD counter. The following...
36) Construct BCD counter and draw block diagram of a three-decade decimal BCD counter. The following must be included (5points) : - a) The truth table of BCD counter b) The implementation of BCD counter c) The three-decades BCD counter
write a assembly language program to convert GRAY to BCD code in 8051
write a assembly language program to convert GRAY to BCD code in 8051
Problem: Convert the following binary number to decimal. 1. 110101.101 Problem: Convert the following decimal number...
Problem: Convert the following binary number to decimal. 1. 110101.101 Problem: Convert the following decimal number to fractional binary representation. 1. 103.5625
The ASCII lowercase letters are separated from the uppercase letters by 32. Thus, to convert a...
The ASCII lowercase letters are separated from the uppercase letters by 32. Thus, to convert a lowercase letter to uppercase, subtract 32 from it. Use this information to write a program that reads characters from the keyboard. Have it convert all lowercase letters to uppercase, and all uppercase letters to lowercase, displaying the result. Make no changes to any other character. Have the program stop when the user enters a period. At the end, have the program display the number...
Write a program in C++ that converts decimal numbers to binary, hexadecimal, and BCD. You are...
Write a program in C++ that converts decimal numbers to binary, hexadecimal, and BCD. You are not allowed to use library functions for conversion. The output should look exactly as follows: DECIMAL      BINARY                     HEXDECIMAL                      BCD 0                      0000 0000                   00                                            0000 0000 0000 1                      0000 0001                   01                                            0000 0000 0001 2                      0000 0010                   02                                            0000 0000 0010 .                       .                                   .                                               . .                       .                                   .                                               . 255                  1111 1111                   FF                                            0010 0101 0101
Construct an even parity Hamming code for 1101010
Construct an even parity Hamming code for 1101010
Convert these machine codes to MIPS instructions: Ox29210003, and Ox8e460002
Convert these machine codes to MIPS instructions: Ox29210003, and Ox8e460002
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT