EET3370  -- Programmable Logic Controller Basics

Number Systems Used in PLC's

 

Weighted Number Systems

BN .  .  .  .  B4  B3  B2  B1  B0  .      B-1  B-2  B-3  B-4         (B-N) 

PN                       P4  P3  P2  P1  P0  .       P-1  P-2  P-3  P-4         (P-N)

B = Base     P = Position

 

Decimal

10N .  .  .  .104  103  102   101  100  .   10-1  10-2  10-3  10-4        (10-N) 

PN                          P4    P3    P2     P1     P0   .    P-1   P-2    P-3   P-4           (P-N)

Value        10000   1000    100        10         1               1/10      1/100    1/1000   1/10000    

 

Binary

2N .  .  .  .  24    23   22   21   20   .   2-1  2-2   2-3  2-4             (2-N)

PN                       P4    P3   P2   P1   P0    .   P-1   P-2   P-3  P-4             (P-N)

Value        16        8         4         2        1              1/2     1/4       1/8       1/16   

 

Octal

8N .  .  .  .  84    83    82    81    80  .   8-1    8-2    8-3    8-4          (8-N) 

PN                       P4    P3     P2    P1    P0   .   P-1   P-2     P-3    P-4          (P-N)

Value         4096     512       64        8           1            1/8        1/64       1/512    1/4096

 

Hexidecimal

16N .  .  .  .164  163  162  161  160  .   16-1  16-2  16-3  16-4         (16-N) 

PN                          P4    P3    P2    P1     P0   .    P-1    P-2    P-3     P-4         (P-N)

Value        65536   4096     256     16          1               1/16      1/256    1/4096    1/65536

Binary, Octal, Decimal, and Hexadecimal Equivalents

 

                          Binary       Oct.     Dec         Hex

-                               0000        000         0            0000

*                              0001        001         1            0001

**                             0010        002         2            0002

***                           0011        003         3            0003

****                         0100        004         4            0004

*****                        0101        005         5            0005

******                      0110        006         6            0006

*******                    0111        007         7            0007

********                   1000        010         8            0008

*********                 1001        011         9            0009

**********               1010        012       10            000A

***********              1011        013       11            000B

************            1100        014       12            000C

*************          1101        015       13            000D

**************         1110        016       14            000E

***************       1111        017       15            000F

****************   10000       020       16            0010

 

 


Conversions

 

 

 


Changing octal to binary and binary to octal using three bit groups example.

 

 

 

 

Changing hexadecimal to binary and binary to hexadecimal using 4 bit groups example.

 


 

 


Storing Numbers in Machine Language

 

 


 

 

Stored positive examples.

 


 

 




Storing and retrieving negative numbers.


 


Stored negative examples.