My Math Forum  

Go Back   My Math Forum > High School Math Forum > Elementary Math

Elementary Math Fractions, Percentages, Word Problems, Equations, Inequations, Factorization, Expansion


Reply
 
LinkBack Thread Tools Display Modes
January 28th, 2018, 02:34 PM   #1
Member
 
Joined: Jan 2016
From: Uk

Posts: 80
Thanks: 2

Adding two BYTEs into a WORD

Hi,
By using a computer programmers calculator, how do I enter 2x BYTEs and get the answer as a WORD, please?
Camerart.
camerart is offline  
 
January 28th, 2018, 02:50 PM   #2
Senior Member
 
romsek's Avatar
 
Joined: Sep 2015
From: USA

Posts: 2,124
Thanks: 1103

can you

enter msb

shift it left 8 bits (or multiply it by 256)

OR (bitwise or)

enter lsb

ENTER

I don't know what your calculator can do.
romsek is online now  
January 28th, 2018, 05:45 PM   #3
Math Team
 
Joined: Oct 2011
From: Ottawa Ontario, Canada

Posts: 13,320
Thanks: 936

Quote:
Originally Posted by camerart View Post
Hi,
a computer programmers calculator
Whadda heck's that? No manual?
Denis is offline  
January 29th, 2018, 12:40 AM   #4
Member
 
Joined: Jan 2016
From: Uk

Posts: 80
Thanks: 2

Hi,
D, a computer programmers calculator = a calculator found on Windows computer set to programming.

R,
I tried

'Set to DEC and BYTE or BIN'

1 OR 1 then switched to WORD. =1.

FF or FF worked. Also x256.

Would you clarify 'OR' a bit more please?
C
Attached Images
File Type: jpg Calculator.jpg (27.2 KB, 3 views)

Last edited by camerart; January 29th, 2018 at 12:44 AM.
camerart is offline  
January 29th, 2018, 04:39 AM   #5
Senior Member
 
Joined: Apr 2014
From: UK

Posts: 888
Thanks: 326

What base are the numbers you want to enter in? if they are hex, just type the MSB followed by the MSByte with the calculator in Hex mode.
If your numbers are decimal, type the MSByte, x256 then add the LSByte, you can use any calculator for this unless you then want to convert the result to Hex after.
If this is something you need to do more than once, use Excel or google sheets, they handle Hex conversions for you too.
weirddave is offline  
January 29th, 2018, 05:05 AM   #6
Member
 
Joined: Jan 2016
From: Uk

Posts: 80
Thanks: 2

Quote:
Originally Posted by weirddave View Post
What base are the numbers you want to enter in? if they are hex, just type the MSB followed by the MSByte with the calculator in Hex mode.
If your numbers are decimal, type the MSByte, x256 then add the LSByte, you can use any calculator for this unless you then want to convert the result to Hex after.
If this is something you need to do more than once, use Excel or google sheets, they handle Hex conversions for you too.
Hi D,
With a calculator I have on the computer (shown in previous post) set to DEC, I can't type say 220, it stops at 22. If i know the HEX, it all work.
C
camerart is offline  
January 29th, 2018, 05:34 AM   #7
Member
 
Joined: Jan 2016
From: Uk

Posts: 80
Thanks: 2

Hi,
I've been playing with the computer calculator, and got confused by '-'s appearing. So I don't think the calculator is for me.
In the program I'm programming, I added a little routine, that does this for me. I have to post the results online to get them verified each time, instead of the calculator.
Thanks to all.
C.
camerart is offline  
January 29th, 2018, 08:51 AM   #8
Senior Member
 
romsek's Avatar
 
Joined: Sep 2015
From: USA

Posts: 2,124
Thanks: 1103

Quote:
Originally Posted by camerart View Post
Hi,
D, a computer programmers calculator = a calculator found on Windows computer set to programming.

R,
I tried

'Set to DEC and BYTE or BIN'

1 OR 1 then switched to WORD. =1.

FF or FF worked. Also x256.

Would you clarify 'OR' a bit more please?
C
the Or button on your calc
romsek is online now  
January 29th, 2018, 10:03 AM   #9
Member
 
Joined: Jan 2016
From: Uk

Posts: 80
Thanks: 2

Quote:
Originally Posted by romsek View Post
the Or button on your calc
Hi R,
I understood that for OR I press the OR button, but no matter, I now use the program, as in my last post, thanks.
C.
camerart is offline  
Reply

  My Math Forum > High School Math Forum > Elementary Math

Tags
adding, bytes, word



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Digits coax Number Theory 8 August 29th, 2015 04:55 AM
adding 2 different nth roots caters Algebra 4 November 22nd, 2014 09:02 PM
Adding functions fsswim1 Pre-Calculus 2 September 20th, 2014 03:47 PM
Adding Sin waves DaveJames Algebra 5 March 26th, 2014 06:34 PM
please help adding fractions??? alternap18 Elementary Math 2 September 25th, 2010 04:28 PM





Copyright © 2018 My Math Forum. All rights reserved.