Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Home
Infrastructure
Infrastructure
Infrastructure
Security
Security
Home
Home
Home
Home
The following is pseudocode, don't take it too literal allthough I guess it will probably run ;-) (* DECLARATION *) VAR size, i : INT; Bitcount : INT := 0; CurBoolVal : BOOL; TheWordIWantToCheck : WORD; END_VAR (* CODE *) size := SIZE_OF(TheWordIWantToCheck); (* dependends on processor memory width but I assume 16 for now *) FOR i := 0 TO size - 1 DO (* eg. count bit 0 to 15 *) CurBoolVal := TheWordIWantToCheck.i; (* Helper to cast Bit i to Bool *) BitCount := BitCount + BOOL_TO_INT(CurBoolVal);...
The following is pseudocode, don't take it too literal allthough I guess it will probably run ;-) (* DECLARATION *) VAR size, i : INT; Bitcount : INT := 0; CurBoolVal : BOOL; TheWordIWantToCheck : WORD; END_VAR (* CODE *) size := SIZE_OF(TheWordIWantToCheck); (* dependends on processor memory width but I assume 16 for now *) FOR i := 0 TO size - 1 DO (* eg. count bit 0 to 15 *) CurBoolVal := TheWordIWantToCheck.i; (* Helper to cast Bit to Bool *) BitCount := BitCount + BOOL_TO_INT(CurBoolVal); (*...
Messages
Messages
Security
Security
Security
Security
Infrastructure
Infrastructure
Infrastructure
Infrastructure
Infrastructure