Number Systems / 数字类型系统
Before we get too far ahead of ourselves, let's take a look at the various number systems used by PLCs.
Many number systems are used by PLCs. Binary and Binary Coded Decimal are popular while octal and hexadecimal systems are also common.
在我们超越自己之前 , 让我们先来看看PLC使用的各种数制系统 。PLC使用许多数制系统 , 二进制和二进制编码的十进制很流行,而八进制和十六进制也很常见 。
Let's look at each:
让我们分别来看一下:
As we do, consider the following formula (Math again!):
先看看下面的数学公式:
Nbase=Ddigit * R^unit + …. D1R^1 + D0R^0
where D=the value of the digit and R=# of digit symbols used in the given number system.
The "*" means multiplication. ( 5 * 10=50)
【二进制11111111转十进制 11111111转十进制】 The "^" means "to the power of".
As you'll recall any number raised to the power of 0 is 1. 10^1=10, 10^2 is 10×10=100, 10^3 is 10x10x10=1000, 10^4 is 10x10x10x10=10000…
其中D=给定数制系统中使用的数字的值,R=给定数制系统中使用的数字的符号# 。
“*”表示乘法(比如5*10=50) 。
“^”表示几次幂 。
大家应该还记得0的任何次方都是1 。10^1=10, 10^2=10×10=100, 10^3=10x10x10=1000……
This lets us convert from any number system back into decimal. Huh? Read on…
这使得我们可以把任何数制系统转换成十进制 。嗯 , 继续阅读吧……
- Decimal – This is the numbering system we use in everyday life. (well most of us do anyway!) We can think of this as base 10 counting. It can be called as base 10 because each digit can have 10 different states. (i.e. 0-9) Since this is not easy to implement in an electronic system it is seldom, if ever, used. If we use the formula above we can find out what the number 456 is. From the formula: Nbase=Ddigit * R^unit + …. D1R^1 + D0R^0
we have (since we're doing base 10, R=10)
=4*10*10 + 5*10 + 6*1
=400 + 50 + 6
=456.
十进制数 – 这是我们在日常生活中最常使用的数字编码系统(反正我们大多数人都是这么做的) 。我们可以把它看成是以10为基数的计数 , 它可以被称为以10为基底,因为这些数字可以有10种不同的状态(即0-9) 。由于这在电子系统中不容易执行,因此很少使用在电子系统中,如果有的话,我们可以用上面的公式求出456是多少 。
从公式 Nbase=Ddigit * R^unit + …. D1R^1 + D0R^0,
我们可以得出:(因为我们以10为基数 , 所以R=10)
N10=D4*10^2 + D5*10^1 + D6*10^0
=4*10*10 + 5*10 + 6*1
=400 + 50 + 6
=456.
- Binary– This is the numbering system computers and PLCs use. It was far easier to design a system in which only 2 numbers (0 and 1) are manipulated (i.e. used). The binary system uses the same basic principles as the decimal system. In decimal we had 10 digits. (0-9) In binary we only have 2 digits (0 and 1). In decimal we count: 0,1,2,3,4,5,6,7,8,9, and instead of going back to zero, we start a new digit and then start from 0 in the original digit location.
In other words, we start by placing a 1 in the second digit location and begin counting again in the original location like this 10,11,12,13, … When again we hit 9, we increment the second digit and start counting from 0 again in the original digit location. Like 20,21,22,23…. of course this keeps repeating. And when we run out of digits in the second digit location we create a third digit and again start from scratch.(i.e. 99, 100, 101, 102…)
Binary works the same way. We start with 0 then 1. Since there is no 2 in binary we must create a new digit.推荐阅读
- ip地址是由多少位二进制来表示的 ip地址由几位二进制数表示
- Excel将十六进制转换成十进制的方法
- 将十进制数转换成十六进制数的方法
- 二进制恋爱亲热被妈妈撞见第几集
- 100021是二进制数吗
- 13+14二进制是多少
- 二进制编码的作用是什么 二进制编码的作用是什么呢
- 三位二进制可以表示几种状态三位二进制可以表示多少种状态
- 十进制225的二进制是 十进制225的二进制是多少
- 十进制32转化为二进制 十进制32转化为二进制是多少