gg代码转xs代码工具_多余3(XS-3)代码和格雷代码

gg代码转xs代码工具

多余的3码 (Excess-3 Code)

Excess-3 Code is a non-weighted BCD (8421) Code. Excess-3 Code is derived from 8421 code by adding 0011 (3) to all code groups. It is a sequential code, thus can be also used for performing arithmetic operations. Also, Excess-3 codes are self-complementing codes in nature. Therefore, subtraction by the method of complement addition is more direct in the XS-3 code than in 8421 BCD code. Like, BCD code, it also has six invalid states which are: 0000, 0001, 0010, 1101, 1110 and 1111.

Excess-3代码是非加权BCD(8421)代码。 通过将0011(3)添加到所有代码组,从8421代码派生出Excess-3代码 。 它是一个顺序代码 ,因此也可以用于执行算术运算。 同样, 多余3码本质上是自补码 。 因此,与8421 BCD码相比,在XS-3码中用补码加法的减法更为直接。 像BCD代码一样,它也有六个无效状态,分别是: 0000、0001、0010、1101、1110和1111

Relationship between Decimal Numbers, Binary Numbers, and XS-3 Numbers can be given as,

十进制数,二进制数和XS-3数字之间的关系可以表示为:

Decimal NumbersBinary NumbersExcess-3 Code (Binary Number + 0011)
000000011
100010100
200100101
300111100
401000111
501011000
610101001
701111010
810001011
910011100
小数 二进制数 多余的3码(二进制数+ 0011)
0 0000 0011
1个 0001 0100
2 0010 0101
3 0011 1100
4 0100 0111
5 0101 1000
6 1010 1001
7 0111 1010
8 1000 1011
9 1001 1100

Example: Represent (1548)10 in Excess-3 notation.

示例:用(Excess-3)表示(1548) 10

Solution:

解:

    1 = 0001 + 0011 = 0100	5 = 0101 + 0011 = 1000
    4 = 0100 + 0011 = 0111	8 = 1000 + 0011 = 1011

Therefore, (1548)10 = 0100 1000 0111 1011 in XS-3 form.

因此,XS-3形式的(1548) 10 = 0100 1000 0111 1011。

格雷码 (Gray Code)

The Gray Code is a non-weighted code and is cyclic as well. It is referred to as cyclic because successive code words in this code differ by only one bit-position i.e., it is a unit distance code. It is also reflective. In many practical applications such as analog to digital conversion, unit distance codes are used.

格雷码 是非加权码 ,也是循环的 。 之所以称为循环,是因为该代码中的连续代码字仅相差一个位位置,即它是一个单位距离代码。 这也是反射性的。 在许多实际应用中,例如模数转换,使用单位距离代码。

将二进制代码转换为格雷代码 (Conversion of Binary Code into Gray Code)

To convert Binary Code into Gray Code, one should have knowledge of truth table of XOR Gate which is as,

要将二进制代码转换为格雷代码,应了解XOR门的真值表,即

Binary to Gray code conversion | Example 1

Now, the MSB of the binary number is copied as it is and then we perform XOR operation for consecutive bits in a pair of two.

现在,按原样复制二进制数的MSB,然后对两个成对的连续位执行XOR操作。

Example 1: Convert (1001)2 into Gray Code.

示例1:将(1001) 2转换为格雷码。

Solution:

解:

Therefore, (1001)2 = (1101)g in gray code.

因此,格雷码为(1001) 2 =(1101) g

Binary to Gray code conversion | Example 2

Example 2: Convert (10)10 into Gray Code.

示例2:将(10) 10转换为格雷码。

Solution:

解:

Firstly, we convert decimal number to binary number and then convert binary to gray code.

首先,我们将十进制数转换为二进制数,然后将二进制数转换为格雷码。

Binary to Gray code conversion | Example 3

Therefore (10)10 = (1111)g

因此(10) 10 =(1111) g

将格雷码转换为二进制数 (Conversion of Gray Code into Binary Number)

The MSB of Gray code is copied as it to be the MSB bit of binary number which is then XORed with the next bot of gray code, the result is recorded as the next bit of binary number, now this recorded bit is XORed with the next bit of gray code and this process is continued till the LSB is obtained.

将格雷码的MSB复制为二进制数的MSB位,然后将其与下一个格雷码机器人异或,将结果记录为二进制数的下一位,现在将该记录的位与下一个异或。位格雷码,此过程将一直持续到获得LSB。

Example 1: Convert (110011100)g to binary number.

示例1:将(110011100) g转换为二进制数。

Solution:

解:

Binary to Gray code conversion | Example 4

Therefore, (110011100)g = (10010111)2

因此,(110011100) g =(10010111) 2

Example 2: Convert (101010101)g to binary number.

示例2:将(101010101) g转换为二进制数。

Solution:

解:

Binary to Gray code conversion | Example 5

Therefore, (101010101)g = (110011001)2

因此,(101010101) g =(110011001) 2

翻译自: https://www.includehelp.com/basics/excess-3-xs-3-code-and-gray-code.aspx

gg代码转xs代码工具

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值