What is the relationship between bytes and BCD codes

Updated on international 2024-02-09
6 answers
  1. Anonymous users2024-02-06

    The BCD code is used to represent the decimal system in binary, and the BCD code is divided into compressed BCD code and uncompressed BCD code. A compressed BCD code is a byte representing two BCD codes, while an uncompressed BCD code is a byte representing an uncompressed BCD code.

  2. Anonymous users2024-02-05

    Upstairs is good, e.g. a byte for a decimal number of 0 255, a byte for 0000 0000 1111 1111;The BCD code is a 4-digit binary number to represent the 10 digits of 0 9 in the 1-digit decimal number, commonly used is 8421-BCD code, each number has its own 8421 code: 0=0000 1=0001 2=0010 3=0011 4=0100 5=0101 6=0110 7=0111 8=1000 9=1001

  3. Anonymous users2024-02-04

    A byte is 8 bits, and a BCD code is represented by a four-bit binary bit, so a byte can put two BCD codes.

  4. Anonymous users2024-02-03

    Multiplication and division can be done without considering the base system, for example, the hexadecimal number 0ffh is stored in a, the decimal number 100 is placed in b, and then div ab, so a is equal to 02h, b is equal to 37h, and is equal to 55

    In then suppose the number in a is ffh

    binbcd:

    mov b, 100 (b=100, decimal 100,).

    div ab (a is equal to 02h, b is equal to 37h is equal to 55).

    mov r3, a (a=02h)

    mov a, #10 (a=10=0ah,b=55=37h)

    xch a,b (a=55=37h, b=10=0ah)

    div ab (a=05h=5 , b=5=05h)

    swap a (a=50h,b=05h)

    add a,b (a=55h,at this time, the bcd of the ten of you has been found,will.

    37h = 55 converted to 55h

    end1 What is the idea of solving this program?

    The idea is to find the modulo and the to find a number to separate the hundreds, tens, and units.

    For example 168168 100 = 1 surplus 68

    68 10 = 6 and 8

    8 1 = 8 remainder 0

    In this way, hundreds, tens, and units are separated.

    2 The second sentence of the program"div ab"The explanation is that the hexadecimal number is divided by 100, but the A should be stored in an eight-digit binary number, what is going on?

    This is the way you don't understand the way the CPU stores data, the storage in a is actually a binary number in the final analysis, the machine only knows the binary number, after compiling this program, the decimal 100 we input also becomes a binary number, we usually say hexadecimal numbers because the hexadecimal number and the binary number have a bitwise correspondence, such as 1100 0110b=c6h That is to say, the binary number is written as a hexadecimal number every 4 digits and a paragraph, and the binary number is converted into hexadecimal number, 3 In the end, why add tens and single digits, isn't it necessary to separate tens and single digits?

    I think if you know what the BCD code means, you will understand.

    The BCD code is a hexadecimal number to represent the decimal number.

    For example, 45h is equal to 69 in decimal, but if you say he is a bcd code, he represents the decimal number 45

    Then you will find that not every hexadecimal number is BCD, for example AAH is not BCD, because there is no decimal number like AA.

    I finally summarize, that is, what we call a decimal number or a hexadecimal number, in the final analysis, the machine is to turn it into a binary number, and the machine only knows the binary number, so that you can understand, we will not deal with the operation between different base numbers, and the operation must convert him to the same base number, the machine is also like this, but we are good at decimal operations, and the machine is good at binary operations, and the number of binary digits is inconvenient, so we found a helper hexadecimal number.

    Hope you understand.

  5. Anonymous users2024-02-02

    The following link has a detailed description of the BCD code, which is essentially unrelated, the BCD code is a way that the machine is using in processing, and the byte is a storage unit of memory.

  6. Anonymous users2024-02-01

    Four. Such as:

    Each byte is 8 bits and can store 8-bit BCD codes.

Related questions
10 answers2024-02-09

Physics is the foundation of philosophy, and philosophy is the sublimation of physics!!

7 answers2024-02-09

Not pasted)

It can be said that Pentium and Core are only sub-brands used by Intel to distinguish product generations, and the biggest difference between them, in general, lies in the core architecture. The Core processor ditches the Netburst architecture of the previous P4. >>>More

34 answers2024-02-09

Mutu: Also known as Mott. The god of death, the god of the underworld, the god of chaos, the god of drought and harvest. is Barr's older brother and main antagonist. From Semitic mythology. >>>More

26 answers2024-02-09

can be regarded as a mother-son relationship, when filming "The Ultimate Family", Lan Xinmei liked Tang Yuzhe, Wang Dongcheng and Huang Xiaorou, the three children who played her children in the play. During the filming of the Chinese New Year, Lan Xinmei went to Japan to play, accidentally injured in Japan, and had difficulty moving after coming back, Tang Yuzhe was a very caring child, so he went to the airport to pick up the airport, and took great care of his mother, so there was a scandal between the two at that time, but the two were just mother-son friendship, after the filming, Lan Xinmei also accepted Tang Yuzhe and Wang Dongcheng and Huang Xiaorou as godchildren, and they also continued to be called in the play, called Lan Xinmei's mother. It's a good year's friend.

8 answers2024-02-09

The hard disk is a part of the computer, which means how much capacity your computer can have, generally 60g 80g 120g 160g. >>>More