Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 8th February 2008, 03:31 AM   (permalink)
Default

Quote:
Originally Posted by Marks256
..
Another question. How does an 8 bit processor handle numbers larger then 255?
One byte or nybble at a time. Check out instructions that set and use the carry flag.
__________________
We never have time to do it right; but we always have time to do it over.
Papabravo is offline  
Old 8th February 2008, 03:37 AM   (permalink)
Default

Its handles larger numbers the same way you do when not using a calculator. ie: When doing addition on paper, you will only deal with single digits at a time and use "carries" to move the values in excess of 9 to the column on the left:

56 + 37 =??

6 + 7 = 13
So keep the 3 in the units column and add the 1 to the 5 & 3 in the 10s column ( 5 + 3 + 1carry = 9 ) so the answer is 93. The 8 bit processor program has to do the same thing except it only has to carry when the answer exceeds 255 (For unsigned math) or 127 (For signed math).
Funny thing on this topic is that I only really learned math once I started writing assembler: I'd never thought about the fact that multiplication is just a form of addition. ie: You can figure out 7 x 13 just by adding 13 to itself 7 times. Too much emphasis on just memorizing multiplication tables when I was growing up I guess.
__________________
--- The days of the digital watch are numbered. ---
kchriste is offline  
Old 8th February 2008, 04:05 AM   (permalink)
Default

Quote:
Originally Posted by Papabravo
One byte or nybble at a time. Check out instructions that set and use the carry flag.
Quote:
Originally Posted by kchriste
Its handles larger numbers the same way you do when not using a calculator. ie: When doing addition on paper, you will only deal with single digits at a time and use "carries" to move the values in excess of 9 to the column on the left:

56 + 37 =??

6 + 7 = 13
So keep the 3 in the units column and add the 1 to the 5 & 3 in the 10s column ( 5 + 3 + 1carry = 9 ) so the answer is 93. The 8 bit processor program has to do the same thing except it only has to carry when the answer exceeds 255 (For unsigned math) or 127 (For signed math).
Funny thing on this topic is that I only really learned math once I started writing assembler: I'd never thought about the fact that multiplication is just a form of addition. ie: You can figure out 7 x 13 just by adding 13 to itself 7 times. Too much emphasis on just memorizing multiplication tables when I was growing up I guess.
Aaah... that sounds simple!

Does anyone know of any books (free would be nice... as in ebooks, but not a requirement) that i can get to read up on z80 Assembly? I understand what most of the op codes do, but there are a few that i can't figure out what their purpose is...
__________________
There is no "I" in "team", unless Apple makes it... Then it would be iTeam.
Marks256 is offline  
Old 8th February 2008, 11:11 AM   (permalink)
Default

Quote:
Originally Posted by Marks256
Does anyone know of any books (free would be nice... as in ebooks, but not a requirement) that i can get to read up on z80 Assembly? I understand what most of the op codes do, but there are a few that i can't figure out what their purpose is...
If you don't understand it, you probably don't need to know about it - a 16F PIC has only 35 instructions, and probably a third of those are only very rarely used (some I've NEVER used!).

As always, build one, and play with it - rather than keep asking silly questions!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 8th February 2008, 11:24 AM   (permalink)
Default

Quote:
Originally Posted by Marks256
Does anyone know of any books (free would be nice... as in ebooks, but not a requirement) that i can get to read up on z80 Assembly? I understand what most of the op codes do, but there are a few that i can't figure out what their purpose is...
Why don't you go to the Z80 support website and get whatever information is available?

Zilog Z80 CPU user manual and other related infos

For those OP codes that troubles you, you can then ask here.
__________________
L.Chung
eblc1388 is offline  
Old 8th February 2008, 11:00 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
If you don't understand it, you probably don't need to know about it - a 16F PIC has only 35 instructions, and probably a third of those are only very rarely used (some I've NEVER used!).

As always, build one, and play with it - rather than keep asking silly questions!.
Is my name Marks35? No. It is Marks256!

I like silly questions.
__________________
There is no "I" in "team", unless Apple makes it... Then it would be iTeam.
Marks256 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Capacitor Charge/Discharge question ThermalRunaway General Electronics Chat 25 12th August 2008 05:48 PM
A/D Converter related question appleseed Electronic Projects Design/Ideas/Reviews 32 4th September 2006 12:06 PM
Basic Transmission question CamNuge General Electronics Chat 2 8th March 2006 11:08 PM
Mobile phone related question waynefeltham Electronic Projects Design/Ideas/Reviews 16 22nd September 2003 10:06 AM
PBX question waqar Electronic Projects Design/Ideas/Reviews 0 30th March 2003 07:21 PM



All times are GMT. The time now is 01:11 PM.


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

eXTReMe Tracker