Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 21st May 2008, 12:57 AM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
Hi arhi,
I think the misunderstanding could lie in the fact, that the cpu 'accumulator' is 8 bits wide and the processing is on 8 bit bytes.
Its just the order which the 'acc' accesses the 8 bit bytes, hi thru lo or vice versa.
So the bit weighting is always the same.
might be the cause of my misunderstanding .. basically when I do sysdev I have to worry about how numbers are stored in RAM if I access memory locations directly (like in my example) .. that is the "core" problem of the whole discussion, as I consider "register" a multibyte memory location...
arhi is offline  
Old 21st May 2008, 05:14 AM   (permalink)
Default ok...

this is 259 (dec) = 0010 0101 1001 (bcd)

so in order to put it in 24bit register i need to :
000000000000001001011001

am i correct??
transgalactic is offline  
Old 21st May 2008, 05:43 AM   (permalink)
Default

Quote:
Originally Posted by transgalactic View Post
this is 259 (dec) = 0010 0101 1001 (bcd)

so in order to put it in 24bit register i need to :
000000000000001001011001

am i correct??
Your first question was to show it as binary .. BCD is binary coded decimal that is not same so double check if you need number with base 2, or bcd coded number, with BCD you need to know do you want packed or not BCD code, your answer is true if you want packed BCD (the most common BCD variant).

note that if you do packed BCD addition, you add the numbers as they were binary numbers (perform normal binary addition) and then add 6 to each digit that is larger then 9
arhi is offline  
Old 21st May 2008, 05:48 AM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
Hi arhi,
I think the misunderstanding could lie in the fact, that the cpu 'accumulator' is 8 bits wide and the processing is on 8 bit bytes.
Its just the order which the 'acc' accesses the 8 bit bytes, hi thru lo or vice versa.
So the bit weighting is always the same.
Endianness - Wikipedia, the free encyclopedia

that's the answer to my problem (where is that banging head smiley) ..
for some strange reason, I decided to believe that multibyte value is stored in register the same way as it is stored in memory .. hence all the ping pong ... but now i understand it is not

thanks for clarification and sorry for the stubbornest, I had to get to the bottom of it to be able to sleep
arhi is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
how to solve this question transgalactic Electronic Projects Design/Ideas/Reviews 3 6th May 2008 09:43 PM
semicondutor material shermaine General Electronics Chat 4 15th September 2007 08:49 PM
Layout Question -- need good reference material Brocktune General Electronics Chat 2 12th May 2004 07:13 PM
Question about reading bits from ports. Blueteeth Micro Controllers 5 5th January 2004 02:08 PM
Reading material frm Texas Inst. mozikluv Datasheet/Parts Requests 5 11th October 2003 02:34 AM



All times are GMT. The time now is 08:38 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

eXTReMe Tracker