EmbeddedRelated.com
Forums

8051 architecture

Started by Unknown July 11, 2006
Did it ever occur to anyone that there may be some people that like to
screw with your brain by posting stuff like that?  Seems many in this
group take delight in demeaning people and replying with insulting
answer.
The simple solution is to not reply to stupid questions, if you think
they're stupid. Of course, that raises the question of what constitutes
a stupid question.  For myself, there are a lot of questions that many
of you would consider stupid and if I would just "read the manual", for
which many here know exactly what page to go to, it should be obvious.
It may be shocking to know this but for the novice, manuals are not
always the easiest to read.  Have any of you ever gone to a co-worker
and asked a question without going to the manual first?  Did he/she ask
you if you checked the manual?  Did they call you stupid?
And no, that poster was not me.


Chris Hills wrote:
> In article <12b6kuc9ikdqa6d@corp.supernews.com>, Meindert Sprang > <ms@NOJUNKcustomORSPAMware.nl> writes > ><eerobert@gmail.com> wrote in message > >news:1152598467.894100.285310@m79g2000cwm.googlegroups.com... > >> Why 8051 need 2 clock cycle for 1 system state? > > > >Because it is designed that way. > > > >Meindert > > > > > Is it just me (and Grant Edwards) or are the questions getting worse and > pointless? > > There is another post asking how to do something that is clearly > explained in the manuals... > > The manuals are electronic and part of the compiler IDE package. Even > the eval and pirated versions have them! > > SO either these people cant read the manuals or can't be bothered. In > either case I think their Internet access should be stopped. > > If they are not that good in English use a language they are good at. > You don't have to use English and I am sure that some one else could > translate for them. > > > -- > \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ > \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ > /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ > \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <GT%sg.120814$mF2.10351@bgtnsc04-news.ops.worldnet.att.net>,
Neil <NeilKurzm@worldnet.att.net> writes
>Tom Lucas wrote: >> "Chris Hills" <chris@phaedsys.org> wrote in message >> news:i93qMbBtP4sEFAcv@phaedsys.demon.co.uk... >>> In article <12b6kuc9ikdqa6d@corp.supernews.com>, Meindert Sprang >>> <ms@NOJUNKcustomORSPAMware.nl> writes >>>> <eerobert@gmail.com> wrote in message >>>> news:1152598467.894100.285310@m79g2000cwm.googlegroups.com... >> >>>>> Why 8051 need 2 clock cycle for 1 system state? >> <snip> >> >>> Is it just me (and Grant Edwards) or are the questions getting worse >>> and >>> pointless? >> >> In this chap's defence then this is not too bad a question and the >> answer doesn't readily present itself from the datasheet. Perhaps he has >> come in from the PIC world where 4 clocks are used and is wondering how >> the 8051 does it in 2. >> >> However, I think it more likely that he wants to know why two clocks are >> required to do one instruction but this in itself is not too obvious if >> you only know the processor as a black box that runs code. Granted, he >> should have spent more time googling but using what search string if he >> doesn't know about fetch-decode-execute and doesn't have great English? >> >> I am also aware that after my mini-rant I still haven't given much help >> to the OP but I don't know a lot about the 8051 and besides, it was a >> pointless question ;-) >> >> >My Phillips Data Book (1994) has some nice timing diagrams showing what >is done for each state on a 12 clocker. >Some of the 6's cheat the work on both clock edges. >Not sure about the others
But he is asking about the 2 clock cycle ones. A different kettle of fish BTW if you can get it the 1997 version was the best Philips data book. After that they went to CE. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1152703599.31886.0@iris.uk.clara.net>, Tom Lucas <news@REMOV
EautoTOflameREPLY.clara.co.uk> writes
> >"Chris Hills" <chris@phaedsys.org> wrote in message >news:5rEM5fDg1+sEFA$C@phaedsys.demon.co.uk... > >>>>>> <ms@NOJUNKcustomORSPAMware.nl> writes >>>>>>><eerobert@gmail.com> wrote in message >>>>>>>news:1152598467.894100.285310@m79g2000cwm.googlegroups.com... >>>>> >>>>>>>> Why 8051 need 2 clock cycle for 1 system state? >>>>><snip> >>>>> >>>> No it was not entirely pointless... however it is like asking why is >>>> DNA >>>> a twin helix. If your command of English is poor or the one line >>>> above >>>> is the total sum of your knowledge there is not wya you will >>>> understand >>>> the answer. >>> >>>I think that it a bit insulting toward the OP - >> >> Not at all. > >It is not for me to be offended on behalf of anyone but it does imply >that the OP hasn't got the brains to understand the reply, rather than >the linguistic ability. However, if the OP is not offended then there is >no problem.
If the OP had enough intellect to understand the answer they would already have found the answer or framed the question differently. A search on google then a refined search would have got a lot of pointers as would the data sheet for the part concerned. This would have lead to a very different question. As Others have commented the OP has not appeared to have done any preliminary work himself. This is either laziness or lack of knowledge. If laziness then why should we answer? If lack of knowledge on how to find things on the Internet then they would lack the sort of mind that would handle the answer. One of which is microcode. But you will have to work out what that is an why it is the answer but not in the case of the 2 cycle 8051's
>>>he may be able to work >>>with the answer and get a good translation. >> >> Then he can ask a better question > >It wasn't that badly asked - it just needed a "does" before the "8051" >and a "the" after to be close to grammatically correct. Perhaps a bit of >background info and a thankyou wouldn't have hurt but it wouldn't added >anything to the question. > >>>I'd discussed in other threads how intimidating this group is for >>>first >>>time posters >> >> It does not seem to bother the people Grant has indicated nor this >> poster. They just ask blunt questions. They don't seem at all >> intimidated. > >That is true, bullheadedness normally wins through on the net.
It doesn't when asking questions which is what Grant was complaining about.
>However, >there are some more polite posters out there who post with trepidation. >I'd like to think that I am considered polite and wouldn't blast >straight in with blunt questions but when you have a straightforward >question there is only so much social preambling you can do before >asking it.
True.
>>>and IMHO the OP had a legitimate question which other >>>people, myself included, would have been interested to see the answer >>>to. >> >> What was the question? Think about it. > >OP ->"Why 8051 need 2 clock cycle for 1 system state?" >My interpretion->"Why does the 8051 require 2 clock cycles for 1 machine >state" > >The beauty of English is its ability to be understood even when badly >spoken - that is part of the reason it is such a successful language. >However, if my interpretation was not the OPs intended question then it >is indeed very badly worded.
Well I think we all read it the same way you did.
> >>> All he's received is abuse and he'll go away none the wiser. >> >> Perhaps it was the way the question was asked? Apart from the question >> itself? >> >> The question was answered BTW. > >There have been lots of ecellent replies but most what people have >actually said was that different instruction take different numbers of >clocks although Isaac alluded to microcode and Neil says he has a book >with the answer in it. Noone has actually given the reason why two >cycles are needed.
Yes, that was answered, precisely and correctly. It is just that the OP did not understand the answer.
> Granted there should be enough here for the OP to >have a renewed attack at google but I couldn't say that the question had >been fully answered.
"a renewed attack"? No evidence of a first attack. that is the point. As Grant (and the FAQ's) say we help those who show some sign of having put some effort in to it in the first place.
>>>I had a >>>bit of a google to see if I could find the answer and there were >>>plenty >>>of hits discussing the clocks/cycle requirements of the 8051 but >>>nothing >>>saying why it was the case. >> >> >> The question was why 2 clock cycles per machine cycle on an 8051. >> Having done some research what have you discovered about the number >> of >> clock cycles to machine cycles on an 8051? > >Well, the main thrust is that there are different numbers for different >instructions/cores/manufacturers which came up in the first google hits >when I first started looking.
You did that but the OP did not appear to have done that.
>If I had a Phillips 1994 data book then >I'd have a good idea what was happening on the original 12 cycle >instructions
Partly but they tend to defer to the original Intel data sheets. However the 12 cycle 51s are not the same core AFAIK as the 2 cycle ones.
>but googling for details of the state machines just tells >me that they exist.
:-) If you realy want to see have a look at the 8051 soft cores.
>I'd like to find out more about it but I haven't really got the time to >search it out because, although the answer is interesting, it is not >particularly relevent to what I'm doing
Exactly. It if was relevant you would spend some time on it. the OP appeared not to have done so. And is one of MANY questions of this type we are starting to get (must be the start of term)
>and it doesn't look like the >answer will be found quickly via google.
With patience.
>My point is that I think that >the OP had a valid question, if not brilliantly worded, and received >some harsh critism which I didn't feel was justified. It doesn't seem to >bother the OP so it may be a moot point but this follows on from >discussions we've had in previous threads.
Yes. That many treat this NG (and others) as a low effort homework answering service. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1152711087.694837.156160@35g2000cwc.googlegroups.com>,
gobraves <sjacobs@lrnelson.com> writes
>Did it ever occur to anyone that there may be some people that like to >screw with your brain by posting stuff like that?
Yes. BTW no one has come back with the place to download a free copy of Microsoft Linux for a PIC16
>Seems many in this >group take delight in demeaning people and replying with insulting >answer.
Only when the question requires it.
>The simple solution is to not reply to stupid questions, if you think >they're stupid. Of course, that raises the question of what constitutes >a stupid question.
Good point. If politely asked and you show some sign of effort on your own part then no question is stupid. The complaint is the one line "I want information" type questions where the OP has appeared not to have put any effort in themselves. There have been a rash of them recently. They seem to appear just after the start of term.
> For myself, there are a lot of questions that many >of you would consider stupid and if I would just "read the manual", for >which many here know exactly what page to go to, it should be obvious. >It may be shocking to know this but for the novice, manuals are not >always the easiest to read.
This is true. :-(
> Have any of you ever gone to a co-worker >and asked a question without going to the manual first?
Yes.
>Did he/she ask >you if you checked the manual?
Yes.
> Did they call you stupid?
Often. :-) and it worked the other way round. However that is where it is very easy to ask across the desk some one I know and work with all day (usually with the manuals sat between us). It is not the same as a blunt one line "I want answer" type question to the NG without having in the manuals.
>And no, that poster was not me.
Or me. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills wrote:
> Yes, that was answered, precisely and correctly. It is just that the OP > did not understand the answer.
I don't belive the OP was ever heard from again (go figure given the reception) to determine what he understood of the answer. Steve
Chris Hills wrote:
> In article <1152649623.527310.218010@p79g2000cwp.googlegroups.com>, > Isaac Bosompem <x86asm@gmail.com> writes >> eerobert@gmail.com wrote: >>> Why 8051 need 2 clock cycle for 1 system state? >> I do not know what you mean by "system state". I only know that the >> 8051 by default takes 12 cycles for a machine state (I think that is >> what you meant). > > The original 8051 took 12 cycles. > > There are many 8051 cores that use one of 12, 6, 4, 2 and 1 cycle per > clock. > > There are some 30-40 different cores out there using different internal > design philosophies from traditional to soft cores fro ASICs. This means > their internal timing is different. > > Some do run in 2 clock cycles per machine state. > > >
When I started with all this microprocessor malarkey, life seemed to be full of low-level machine architecture with much talk of things like fetch-execute cycles. By and large, many folk seem not to either want or need to know about these things, especially if all their development is done in a high level language. Not long ago I was sharing a moaning session with a university lecturer about how electronics students don't seem to have to know much at all about semiconductor junctions in order to get a degree. But I digress.. The OP asked a question that we must assume had some meaning and relevance to him. Granted, it was poorly phrased and possibly ambiguous. However, almost nobody seems to have tried answering the question and most seem to have almost willfully misinterpreted it. the original question asks about the need for 2 clocks per machine state in the 8051. A quick look at the Philips databook to remind me what an 8051 was (just kidding - stay calm) shows that a machine cycle consists of six machine states, each requiring 2 clocks. So all this stuff about 1, 2, 4, 6 and 12 clock variants is a bit beside the point. If the OP really meant machine state (as written) rather than machine cycle (as read by most) then the question is probably quite fair. Certainly, a look at the Philips databook makes things a bit more clear. There is a small section specifically about CPU timing and Machine cycles. However, the family hardware guides most likely to be found by a less than thorough Google search don't always mention it. The 80C51 Family Architecture document found here: http://www.semiconductors.philips.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf says what there is to say I think although it still falls short of explaining why two oscillator periods are required for each machine state. Sadly the most succinct answer posted so far is just as unhelpful - it was designed that way. All the actions appear to take place on the falling edge of the oscillator clock. using both edges would have taken a single clock per state but was presumably an expensive complication at the time the original 8051 was designed. Of course, the OP could have simply dropped a 1 and meant why 12 clocks per machine cycle - who knows. We will never find out because he has probably been securely frightened away and should not cause any more embarrassment to himself or others. Pete Harrison
In article <1152737609.170000.263430@h48g2000cwc.googlegroups.com>,
steve_schefter@hotmail.com writes
>Chris Hills wrote: >> Yes, that was answered, precisely and correctly. It is just that the OP >> did not understand the answer. > >I don't belive the OP was ever heard from again (go figure given >the reception) to determine what he understood of the answer.
None of them are usually heard from again often because the ask for the information to be emailed to them so they don't have to keep looking at the NG. Though some become persistent trolls asking the same question in several NG's at half an hour intervals. Others argue, usually about their right to top post and , before google corrected things, about not quoting the message they were replying to.... Anyone, as has been explained many times in most of the programming and embedded NG's, will get an answer if they ask questions politely and show they have at least made an attempt to solve the problem themselves. There are other NGs where they are so fed up with the "how do I program in C, C++ and web design email to .... " type questions that the response is usually less charitable than here. As Grant said in another thread over the last couple of years the number of questions that are asked that appear to be blatant homework or where the poster has not even done any basic research themselves is increasing alarmingly. In some of the C programming NG's you actually get homework questions posted pretending to me a real technical query. A decade ago it was not like this at all. Some of use are getting fed up with it. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
"Peter Harrison" <peter_harrison@ntlworld.com> wrote in message 
news:mzetg.24802$1g.19925@newsfe1-win.ntli.net...
> Chris Hills wrote: >> In article <1152649623.527310.218010@p79g2000cwp.googlegroups.com>, >> Isaac Bosompem <x86asm@gmail.com> writes >>> eerobert@gmail.com wrote: >>>> Why 8051 need 2 clock cycle for 1 system state? >>> I do not know what you mean by "system state". I only know that the >>> 8051 by default takes 12 cycles for a machine state (I think that is >>> what you meant). >> >> The original 8051 took 12 cycles. There are many 8051 cores that use >> one of 12, 6, 4, 2 and 1 cycle per >> clock. There are some 30-40 different cores out there using different >> internal >> design philosophies from traditional to soft cores fro ASICs. This >> means >> their internal timing is different. >> >> Some do run in 2 clock cycles per machine state. > > When I started with all this microprocessor malarkey, life seemed to > be full of low-level machine architecture with much talk of things > like fetch-execute cycles. By and large, many folk seem not to either > want or need to know about these things, especially if all their > development is done in a high level language. Not long ago I was > sharing a moaning session with a university lecturer about how > electronics students don't seem to have to know much at all about > semiconductor junctions in order to get a degree. But I digress.. > > The OP asked a question that we must assume had some meaning and > relevance to him. Granted, it was poorly phrased and possibly > ambiguous. However, almost nobody seems to have tried answering the > question and most seem to have almost willfully misinterpreted it. the > original question asks about the need for 2 clocks per machine state > in the 8051. A quick look at the Philips databook to remind me what an > 8051 was (just kidding - stay calm) shows that a machine cycle > consists of six machine states, each requiring 2 clocks. So all this > stuff about 1, 2, 4, 6 and 12 clock variants is a bit beside the > point. If the OP really meant machine state (as written) rather than > machine cycle (as read by most) then the question is probably quite > fair. Certainly, a look at the Philips databook makes things a bit > more clear. There is a small section specifically about CPU timing and > Machine cycles. However, the family hardware guides most likely to be > found by a less than thorough Google search don't always mention it. > The 80C51 Family Architecture document found here: > > http://www.semiconductors.philips.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf > > says what there is to say I think although it still falls short of > explaining why two oscillator periods are required for each machine > state. > > Sadly the most succinct answer posted so far is just as unhelpful - it > was designed that way. All the actions appear to take place on the > falling edge of the oscillator clock. using both edges would have > taken a single clock per state but was presumably an expensive > complication at the time the original 8051 was designed. > > > Of course, the OP could have simply dropped a 1 and meant why 12 > clocks per machine cycle - who knows. We will never find out because > he has probably been securely frightened away and should not cause any > more embarrassment to himself or others. > > Pete Harrison
<original post deliberately reposted in full> Thank you for that - I'd been interested to know the answer as well and, whilst some of the posts here offered some help, this is the first to provide a satisfactory answer for the OP.
"Chris Hills" <chris@phaedsys.org> wrote in message 
news:FAFzjHBgvVtEFACh@phaedsys.demon.co.uk...
> In article <1152703599.31886.0@iris.uk.clara.net>, Tom Lucas > <news@REMOV > EautoTOflameREPLY.clara.co.uk> writes
>>>>I think that it a bit insulting toward the OP - >>> >>> Not at all. >> >>It is not for me to be offended on behalf of anyone but it does imply >>that the OP hasn't got the brains to understand the reply, rather than >>the linguistic ability. However, if the OP is not offended then there >>is >>no problem. > > If the OP had enough intellect to understand the answer they would > already have found the answer or framed the question differently. A > search on google then a refined search would have got a lot of > pointers > as would the data sheet for the part concerned.
I had a search on google and I didn't find the answer, although I had no problem understanding Peter Harrison's generous answer. You can't say that the OP hadn't attempted to google for it because google won't yield an answer without a lot of cajoling. I don't know what part he had but not all datasheets are as helpful as others - perhaps the OP's was one of the more vague.
> This would have lead to a very different question. As Others have > commented the OP has not appeared to have done any preliminary work > himself.
What are you basing this on? At first glance then it looks to be the case but looking deeper then it has not proved to be and it's premature to just dismiss it out of hand. However, if the OP really did do no research then they should be ashamed - my point is that it is not obvious whether they have or not.
> This is either laziness or lack of knowledge. > If laziness then why should we answer? > If lack of knowledge on how to find things on the Internet then they > would lack the sort of mind that would handle the answer.
I'm aghast. That is _exactly_ the sort of elitism that rears its ugly head far too often on this group. The OP may well have exhausted his google talent searching but there is a fair level of skill and knowledge required to post a usenet question, even with Google groups making it more accessible. I used to work with a brilliant principle engineer who designed what is regarded to be the greatest ever CRT deflection amplifier but wouldn't have the first clue about how to post a question to c.a.e. As I've already said it is not clear whether the OP had searched or not, and there main crime was a curt question. In lots of Far Eastern cultures then there is no need for preamble and you can ask the question right out. Whilst, it is possible that the OP is a local boy who should know better, there is not nearly enough evidence to be as rude to them as you have been. When you reply to a question then your answers are normally well considered and helpful but if you don't like someone's question then simply don't repond to it, but please don't lambast the OP for their lack of knowledge - we all have to start somewhere. I would rather see lots of newbie questions going unanswered than one where the poster got such a savaging that all other newbies are frightened to post. No-one is paying by the byte anymore and it is hardly an effort to skip over the posts you don't like until you find something you do. <snip>
>> >>There have been lots of ecellent replies but most what people have >>actually said was that different instruction take different numbers of >>clocks although Isaac alluded to microcode and Neil says he has a book >>with the answer in it. Noone has actually given the reason why two >>cycles are needed. > > Yes, that was answered, precisely and correctly. It is just that the > OP > did not understand the answer.
Where? By who? Only Peter Harrison's has hit the mark - all the others skirted around it.
>> Granted there should be enough here for the OP to >>have a renewed attack at google but I couldn't say that the question >>had >>been fully answered. > > "a renewed attack"? No evidence of a first attack. that is the point. > As Grant (and the FAQ's) say we help those who show some sign of > having > put some effort in to it in the first place.
Well I've already discussed the google evidence. As for the FAQ, I asked before without luck, but where is it? I have found a vxworks one and a real time one but there doesn't appear to be a c.a.e FAQ. Perhaps it would useful for Google groups to have a hyperlink to a group's FAQ when you are in the group. <snip>
> > Yes. That many treat this NG (and others) as a low effort homework > answering service.
I agree that that is a problem but I don't think the OP in this case was doing homework - the question is too advanced for most students and is highly unlikely to be covered in most courses these days.
Peter Harrison wrote:


> The OP asked a question that we must assume had some meaning and > relevance to him. Granted, it was poorly phrased and possibly ambiguous. > However, almost nobody seems to have tried answering the question and > most seem to have almost willfully misinterpreted it. the original > question asks about the need for 2 clocks per machine state in the 8051. > A quick look at the Philips databook to remind me what an 8051 was (just > kidding - stay calm) shows that a machine cycle consists of six machine > states, each requiring 2 clocks. So all this stuff about 1, 2, 4, 6 and > 12 clock variants is a bit beside the point. If the OP really meant > machine state (as written) rather than machine cycle (as read by most) > then the question is probably quite fair. Certainly, a look at the > Philips databook makes things a bit more clear. There is a small section > specifically about CPU timing and Machine cycles. However, the family > hardware guides most likely to be found by a less than thorough Google > search don't always mention it. The 80C51 Family Architecture document > found here: > > http://www.semiconductors.philips.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf >
I guess the reason is the way the first generation of 8051 is designed. (there wasn't VHDL/Verilog at that time, the chip layout was manually created). At that time, registers could be implemented as latches. So the first 8051 might have used "register" design that required multiple clock phases to drive. For example, 1 flip-flop = 2 multiplexer latches in series As a result, 2 clock cycles might be required to ensure correct operation of the register. And the design use 2 clock cycles for each machine state. Joseph