ISaGRAF. Version 3.4

         

SHR


Àðãóìåíòû:

IN                         INT                 ëþáàÿ öåëàÿ àíàëîãîâàÿ âåëè÷èíà

NbR                     INT                 êîëè÷åñòâà ñäâèãàåìûõ áèò (â äèàïàçîíå [1..31])

Q                          INT                 ïðîâåðíóòàÿ âïðàâî âåëè÷èíà

                                                        åñëè NbR <= 0, òî íåò íèêàêîãî ýôôåêòà

                                                        ìëàäøèé áèò çàìåíÿåò íóëåì

Îïèñàíèå:

Ñäâèãàåò áèòû âëåâî. Ñäâèãàþòñÿ 32 áèòà.

(*FBD ïðèìåð áëîêà “SHR”*)

(* ST Ýêâèâàëåíò: *)

result := SHR (register,1);

(* register = 2#1100_1101_0011_0101 *)

(* result    = 2#1110_0110_1001_1010 *)

(* IL Ýêâèâàëåíò: *)

LD                     register

SHR                  1

ST                     result



Ñîäåðæàíèå  Íàçàä  Âïåðåä