Chapter 5 Instruction Specifications

Item number

Application instructions-19

 

 

Name

 

BCD → Binary conversion

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

 

 

 

Condition code

 

 

 

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

 

R7F3

 

R7F2

R7F1

 

R7F0

Average

 

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIN (d, s)

 

 

DER

 

ERR

 

SD

 

V

 

 

 

C

 

 

 

 

 

 

 

Upper case: W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

49

 

 

 

Lower case: DW

 

 

 

 

 

 

 

 

 

z

 

 

z

 

z

 

 

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

 

 

 

Number of steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIN (d, s)

 

 

 

 

 

Word

 

 

 

 

 

3

 

 

75

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Double word

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

 

Usable I/O

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Other

 

X

 

Y

M

 

 

CU, CT

 

WX

WY

WM

 

TC

DX

DY

 

DM

 

 

 

 

 

 

 

 

 

R,

 

 

TD, SS,

 

 

 

 

WR,

 

 

 

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

I/O after conversion (BIN)

 

 

 

 

 

 

 

 

 

 

{

 

{

 

 

 

{

 

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s

I/O before conversion

 

 

 

 

 

 

 

 

 

{

{

 

{

 

{

{

{

 

{

 

{

 

 

(BCD)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The result of the content conversion of s from BCD to binary is output to d.

If the contents of s are not BCD data (if A through F is included in the data), DER (R7F4) is set to '1' and the conversion will not be executed (d remains unchanged).

Before execution

s

 

6

 

 

 

 

9

 

 

 

 

9

 

 

 

 

1

 

 

(BCD)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

 

1

 

0

1

0

 

0

 

1

1

0

 

0

 

1

0

0

 

0

 

1

After execution

d

 

1

 

 

 

 

B

 

 

 

 

4

 

 

 

 

F

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(Binary)

 

0

 

0

 

1

1

0

 

1

 

1

0

1

 

0

 

0

1

1

 

1

 

1

Combinations of d and s.

ds

WordWord

Double word

Double word

Notes

If a data error occurred, the previous contents of d are retained. Program example

 

X00000

 

 

LD X00000

 

BIN (WM0010, WR000 )

 

[

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIN (WM0010, WR000)

 

 

 

 

 

 

 

 

 

 

 

 

]

 

 

 

 

 

 

Program description

When X00000 turns on, the content of WR000 is converted from BCD to binary and output.

WR000 H6691

After conversion

WM0010 H1B4F

BIN (d, s)

5-91

Page 141
Image 141
Hitachi NJI-350B manual Application instructions-19, BCD → Binary conversion, After conversion BIN Before conversion, Bcd