What does it mean, you must make sure R0>0,R1>0,R0*R1<32768

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What does it mean, you must make sure R0>0,R1>0,R0*R1<32768

woodylcy

So shall I test these conditions in my program?
In addition, we know R0  R1 is 16 bits, So R0*R1, we should use 32 bits to store the result. So how Can I store the result ?
 
Reply | Threaded
Open this post in threaded view
|

Re: What does it mean, you must make sure R0>0,R1>0,R0*R1<32768

cadet1620
Administrator
woodylcy wrote
So shall I test these conditions in my program?
In addition, we know R0 R1 is 16 bits, So R0*R1, we should use 32 bits to store the result. So how Can I store the result ?
The book says that we may assume that these conditions
R0>0,
R1>0,
R0*R1<32768
hold for all inputs that our program is going to receive from the test script. Therefore, you don't need to test the initial values, nor do you need to worry about answers that are greater than 15 bits.

--Mark