wjmosesjr
Guest
W
In SLC 500 language, how can I accomplish the following:
N7:0 xxxx xxxx 0101 1101 (only 8 bits will be needed for both)
N7:1 xxxx xxxx 1010 0011
n7:0 will be holding seconds (resets every 60)
n7:1 will be holding minutes (resets every 99)
I want to combine these two numbers into a BCD 16 bit words such that:
n7:1 upper byte = minutes, lower byte = seconds, for BCD conversion.
I will be outputing a 16 bit BCD number
I am confused about the bit shift left instruction, and when to convert to BCD for output. I'm thinking BCD conversion should be done before any shifting, and combing of words.
Thanks,
Bill M.
N7:0 xxxx xxxx 0101 1101 (only 8 bits will be needed for both)
N7:1 xxxx xxxx 1010 0011
n7:0 will be holding seconds (resets every 60)
n7:1 will be holding minutes (resets every 99)
I want to combine these two numbers into a BCD 16 bit words such that:
n7:1 upper byte = minutes, lower byte = seconds, for BCD conversion.
I will be outputing a 16 bit BCD number
I am confused about the bit shift left instruction, and when to convert to BCD for output. I'm thinking BCD conversion should be done before any shifting, and combing of words.
Thanks,
Bill M.