Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

multiply a variable x 2

Status
Not open for further replies.

savnik

Junior Member level 2
Joined
Apr 23, 2003
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
121
I have a variable which is byte and change from 0-255
and the result show on LCD.
I want to multiply the variable x 2 , therefore will change from 0-512 (now is word) and to show on Lcd.
 

leftshift, if there is an overflow, increment next byte. The result is in two bytes (16 bits), convert and show.
However, please describe the issue in detail.
 

    savnik

    Points: 2
    Helpful Answer Positive Rating
consult mazidi book for details

i can give u hints

separate the lower and higher bytes of result and then use them

OR

result is in accumulator, point to its address and generate the ASCII to send directly to LCD


OR
MAKE A BIG CODE
do not multiply actually, just get the input and using copmarison make differnet 256 loops for 0 to 255

then in each loop generate the desired output on lcd ie for loop 255 send to lcd
0 then 1 then 5

which makes 510

its the easiest way to solve ur problem
 

lease describe the issue in detail
 

also you can add the value twice... you can do it in BCD so no need to do it in 16-bits...
 

Kurenai_ryu said:
also you can add the value twice... you can do it in BCD so no need to do it in 16-bits...

there are many things which can b done
but the problem is of bits, only 8 bits are available by one port or a single command.

here the looping will solve problem that after taking input from one port dont multiply it, just compare it and go to respective loop to send output to lcd
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top