Digital-electronics 简明教程

What is 8421 BCD Code?

8421 BCD code 是数字电子领域中使用最广泛的二进制代码之一。该二进制代码用于将十进制数字从 0 到 9 编码为其等效的二进制格式。

The 8421 BCD code is one of the most commonly used binary codes in the field of digital electronics. This binary code is used to encode decimal digits from 0 to 9 in their equivalent binary format.

阅读本章节以了解所有关于 8421 BCD 码的内容,包括其优势、局限性和应用。

Read this chapter to learn all about 8421 BCD codes including its advantages, limitations, and applications.

What is 8421 BCD Code?

在数字电子中,8421 BCD 码是一种二进制码。BCD 代表二进制编码十进制。8421 BCD 码是最广泛使用的二进制码,用于以其等效二进制格式表示十进制数。

In digital electronics, the 8421 BCD code is a type of binary code. BCD stands for Binary Coded Decimal. The 8421 BCD code is the most widely used binary code for expressing decimal numbers in their equivalent binary format.

8421 BCD 码也称为自然 BCD 码。它是一种二进制码,用于通过使用 4 位的独特组合来表示每个十进制数字。它是一种加权二进制码,也是一种顺序二进制码。

The 8421 BCD code is also known as the natural BCD code. It is a binary code used to represent each decimal digit by using a unique combination of 4-bits. It is a weighted binary code and is also a sequential binary code.

数字 8421 表示分配给四个二进制位中的每一个的权重,其中最高有效位具有 8 的权重,最低有效位具有 1 的权重。

The digits 8421 represents the weights assigned to each of the four bits, where the most significant bit has a weight of 8 and the least significant bit has a weight of 1.

在 8421 BCD 码中,每个十进制数字都可以用唯一的 4 位二进制码表示。下表突出显示了每个十进制数字的 8421 BCD 码。

In the 8421 BCD code, each decimal digit can be represented by a unique 4-bit binary code. The following table highlights the 8421 BCD code for each decimal digit.

Decimal Digit

8421 BCD Code

0

0000

1

0001

2

0010

3

0011

4

0100

5

0101

6

0110

7

0111

8

1000

9

1001

8421 BCD 码是数字电子中最常用的代码,用于以二进制形式表示十进制数。它主要用于需要人机交互的数字设备中。

The 8421 BCD code is the most commonly used code in digital electronics to represent decimal numbers in binary form. It is mainly used in digital devices where human machine interface is required.

Advantages of 8421 BCD Code

在数字电子中,8421 BCD 码具有多个优势,主要在数字系统中使用十进制数的应用中。8421 BCD 码的一些主要优点如下:

In digital electronics, the 8421 BCD code has several advantages, mainly in applications where decimal numbers are used in a digital system. Some of the key benefits of the 8421 BCD code are given below −

  1. The 8421 BCD code provides a natural way of representing decimal numbers. This is because, we can directly encode each decimal digit into its equivalent 4-bit binary number.

  2. The 8421 BCD code allows for simple conversion between decimal and binary number systems. Hence, it is quite useful in digital devices where human input is required.

  3. The 8421 BCD code simplifies the arithmetic operations such as addition, subtraction, multiplication, and division of decimal numbers using a digital system like a calculator.

  4. The 8421 BCD code is compatible with decimal displays. Hence, it is commonly used in digital devices where the output has to be displayed on a decimal-based display like 7-segment display.

所有这些都是 8421 BCD 码的主要优势。然而,8421 BCD 码也有一些缺点,我们来讨论一下。

All these are the main advantages of 8421 BCD code. However, there are also some disadvantages of 8421 BCD code, let’s discuss them.

Disadvantages of 8421 BCD Code

以下是使用 8421 BCD 码的一些主要缺点:

Listed below are some of the major disadvantages of using the 8421 BCD code −

  1. The 8421 BCD code is relatively less efficient than the pure binary code, as it requires a greater number of bits to represent a decimal number. For example, the decimal number 15 can be represented as 1111 in pure binary, whereas 0001 0101 in 8421 BCD.

  2. The arithmetic operations such as addition, subtraction, multiplication, and division performed in 8421 BCD code are relative more complex than they are in pure binary.

  3. The 8421 BCD code consumes more storage space as it uses 4 bits to represent each decimal digit.

  4. In the case of 8421 BCD code arithmetic, the rules of binary arithmetic cannot be applied to the entire 8421 BCD number, but only to the individual groups of 4-bits.

  5. The 8421 BCD codes are not suitable in applications where speed and efficiency are critical.

  6. In 8421 BCD code, there are six illegal code combinations. They are 1010, 1011, 1100, 1101, 1110, and 1111.

因此,所有这些都是 8421 BCD 码的主要缺点。

Thus, all these are the main disadvantages of the 8421 BCD code.

Applications of 8421 BCD Code

8421 BCD 码在数字电子学的各种应用中得到广泛使用。下面给出了 8421 BCD 码的一些关键应用 −

The 8421 BCD code is widely used in various applications in digital electronics. Given below are some of the key applications of the 8421 BCD code −

8421 BCD 码主要用于计算器、数字时钟和手表等数字显示器,其中要显示十进制数字。

The 8421 BCD code is mainly used in digital displays used in calculators, digital clocks and watches, etc. where decimal digits are to be displayed.

  1. The 8421 BCD code is also used in device that accept numeric inputs like calculators.

  2. In process control systems, the 8421 BCD code is used to represent and manipulate the decimal values.

  3. The 8421 BCD codes are also used in embedded systems where human machine interaction is critical.

  4. The 8421 BCD code is widely used in control panels of various electronic devices to display numerical values.

以上是对 8421 BCD 码基础知识的全部介绍。在下一节中,我们将解释如何对 8421 BCD 码执行加法和减法。

This is all about the basics of the 8421 BCD code. In the next section, we will explain how you can perform addition and subtraction of 8421 BCD codes.

Addition in 8421 BCD Code

8421 BCD 码中的加法运算通过以 4 位二进制形式表示的给定十进制数的相应位数的分别相加来执行。

The addition operations in 8421 BCD code are performed by individually adding the corresponding digits of the given decimal numbers expressed in 4-bit binary form.

在 BCD 加法中,如果没有环绕进位,则和不是非法 BCD 码。因此,不需要任何更正。

In BCD addition, if there is no end-around carry, the sum is not an illegal BCD code. Thus, it does not require any correction.

如果从一组到下一组有一个环绕进位,或者如果和是无效码,则通过将 0110 加到和项中来纠正它,并将所得进位加入下一组。

If there is an end-around carry from one group to the next group, of if the sum is an illegal code, then it is corrected by adding 0110 to the sum term and the resulting carry is added to the next group.

让我们借助示例了解 BCD 加法。

Let us understand the BCD addition with the help of an example.

Example

在 8421 BCD 码中加入 251 和 353。

Add 251 and 353 in the 8421 BCD code.

Solution

将给定的十进制数转换为 BCD 码,

Converting the given decimal numbers into BCD code,

251 = 0010 0101 0001

353 = 0011 0101 0011

添加 BCD 码,

Adding the BCD codes,

8421 bcd code

因此,251 和 353 的和是 604。

Hence, the sum of 251 and 353 is 604.

Subtraction in 8421 BCD Code

要使用 8421 BCD 码执行十进制数的减法,我们首先将给定的十进制数转换为它们的 8421 BCD 码。然后,我们从 LSD 开始从 BCD 被减数中减去 BCD 减数。

To perform subtraction of decimal numbers using 8421 BCD code, we first convert the given decimal numbers into their 8421 BCD codes. Then, we subtract the BCD subtrahend from the BCD minuend starting from the LSD.

如果没有从下一高位组借位,则无需更正。如果有从下一高位组借位,则需要通过从中间差项中减去 0110 来获得结果。

If there is no borrow from the next higher group, then no correction is needed. If there is a borrow from the next higher group, then the result has to be obtained by subtracting 0110 from the intermediate difference term.

让我们通过一个例子来理解 BCD 减法。

Let us take an example to understand the BCD subtraction.

Example

在 8421 BCD 码中从 25 中减去 15。

Subtract 15 from 25 in 8421 BCD code.

Solution

将给定的十进制数转换为 BCD 码,

Converting the given decimal number into BCD code,

25 = 0010 0101

15 = 0001 0101

减去 BCD 码,

Subtracting the BCD code,

subtraction 8421 bcd code

因此,25 和 15 的差为 10。

Hence, the difference of 25 and 15 is 10.

Conclusion

总之,8421 BCD 码是一种广泛用于数字电子设备中的自然二进制编码十进制码。它主要用于十进制数字和人机交互至关重要的应用中。

In conclusion, the 8421 BCD code is a natural binary coded decimal code widely used in digital electronics. It is primarily used in applications where decimal digits and human interaction are critical.

8421 BCD 码最显着的优势在于它可以轻松转换十进制数。但它是一种节省空间的较少代码,因为它需要更多位来表示一个十进制数字。

The most significant advantage of the 8421 BCD code is that it provides an easy conversion to and from decimal numbers. But it is less space efficient code because it requires more bits to represent a decimal digit.