6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Oct 07, 2024 12:20 am

All times are UTC




Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 15  Next
Author Message
 Post subject: Re: Breaking 6502 apart
PostPosted: Sat Jul 07, 2012 6:29 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Todays speccy : Program Counter Low part (PCL)

Image Image

I do not know (yet) why these regular structures are different between PCL0/2/4/6 and PCL1/3/5/7.

Also PCL1/3/5/7 saved in latch in inverted form.

Input driver signal is IPC (increment PC).

Output goes from PCLn latch and optionally feed back to PCLSn latch, if PCL/PCL is driven high.

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sat Jul 07, 2012 10:35 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Quote:
I do not know (yet) why these regular structures are different between PCL0/2/4/6 and PCL1/3/5/7.
The difference is due to inverters in the path of alternate data bits (eg: PCL1/3/5/7). This is part of a logic optimization that results in a faster incrementer. The incrementer's most critical path is not the individual data bits but the Carry chain that cascades from one stage to the next -- a total of 8 levels. In order to build the fastest incrementer, all efforts must focus on speeding up the Carry chain. To this end it proves advantageous to operate each alternate incrementer stage with active-low logic (where logic low represents a 1). That means adding inverters around the incrementer stage of each alternate data bit, but it effectively allows the elimination of eight inverters from the Carry chain. (I'll try to rustle up a diagram illustrating this.)

-- Jeff

edit: "allows the elimination of eight inverters from the Carry chain" (not four)

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Sun Jul 08, 2012 3:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 08, 2012 7:56 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Thanks for explanation Jeff, I understood - this trick is need to reduce propagation delay.

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 08, 2012 4:31 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
org wrote:
Thanks for explanation Jeff, I understood - this trick is need to reduce propagation delay.
To reduce propagation delay, yes. In case anyone else is wondering, here's the diagram -- which hopefully is an improvement over my verbal description! The diagram shows the incrementer (just the first four stages) before and after optimization. The optimized version (on the right) uses active-low logic in alternate stages. (I've drawn bits 1/3/5/7 as being the ones that are inverted but in fact it may be bits 0/2/4/6 instead; I don't know.)

The two versions produce identical results, but the unoptimized version is slower because it's obliged to employ inverters in the Carry path. That's because an AND function is required, which must be implemented as NAND followed by an inverter. Of course the optimized version also features inverters, but they don't result in a cumulative delay because they're not part of the eight-level Carry chain.
Attachment:
incrementer stages .gif
incrementer stages .gif [ 7.19 KiB | Viewed 1841 times ]
Edit: alteration to diagram (see subsequent posts)

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Sun Jul 08, 2012 10:54 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 08, 2012 6:38 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Thanks for the drawings, you saved a lot time for me )

Meanwhile, todays speccy : Program Counter High part (PCH)

Image Image

Nothing unusual here ) Same optimized incrementer, but there is separated increment logic for PCH0-3 and PCH-4-7.

PCH0-3 feeds PCLC and output PCHC, which is routed to PCH4-7.

Both schematics perfectly fit in D.Hanson diagram :
Image

Code:
PHI1:
if (PCL/PCL) PCLS = PCL;
if (ADL/PCL) PCLS = ADL;
if (PCL/PCL && ADL/PCL) PCLS = PCL & ADL;
if (PCH/PCH) PCHS = PCH;
if (ADH/PCH) PCHS = ADH;
if (PCH/PCH && ADH/PCH) PCHS = PCH & ADH;

if (IPC) PCLS++;
if (PCLS == 0) PCHS++;

if (PCL/DB) DB = PCL;
if (PCL/ADL) ADL = PCL;
if (PCH/DB) DB = PCH;
if (PCH/ADH) ADH = PCH;

PHI2:
PCL = PCLS;
PCH = PCHS;
ADH = ADL = DB = 0xFF

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 08, 2012 9:09 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Do you need to invert every other output bit?

Inverting both inputs to an exclusive OR gate leaves the output unchanged.

Lee.


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 08, 2012 10:10 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
D'oh! You're right. In negative logic the XOR function is accomplished by an XNOR gate. So for bits 1,3,5,7 I should've drawn XNOR... followed by an inverter because the output is supposed to drive circuitry using positive logic. Of course XNOR followed by an inverter is the same as simply XOR. I'll fix the diagram. Thanks, Lee.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Jul 09, 2012 7:33 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Found one of my old posts which points us to this page by Dieter Mueller.


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Jul 09, 2012 8:46 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Dieter has updates coming too.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Jul 09, 2012 2:21 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
More progress on crazy logic :

Image

I began to understand how it works in general :)

PLA outputs are joined in "groups".
Groups on the left works with X,Y and S registers (resided underneath).
Groups on the middle are ALU related, which feed its inputs.
Groups on the right are branch/flag/compare and (possibly) interrupt/reset logic; instructions related to program counter (PC is resided on the bottom right side of the 6502).

Also there is intense metall layer crosspassing from the left to the right, for addressing calculations purposes.

Hope to crunch it fast, when I get full color schematics (good for LSD trips BTW :mrgreen: )

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Jul 09, 2012 5:05 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
In case someone interested, Visual6502 wiki has hidden section, which I found by poking Random page:

http://visual6502.org/wiki/index.php?ti ... atic_Notes

There is poor photos of 6502 blueprints.

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Tue Jul 10, 2012 1:14 pm 
Offline

Joined: Wed Jul 04, 2012 1:07 am
Posts: 1
org wrote:
There is poor photos of 6502 blueprints.

Actually it's not a photo but a size-reduced version of a scan of the blueprint. A photo would have no or different artifacts at the places where overlapping sections are merged.


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Jul 11, 2012 6:04 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
I mean images ) Sorry my language )

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Jul 11, 2012 1:02 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Todays speccy: Random logic A/B groups.

I separated PLA outputs on groups A,B,C,D,E,F,G,H and K.

Here is preview of below schematics :
Image

Top part:
Image

Bottom part:
Image

Also there is small logic to generate internal 43 and 1247 lines, which are used on bottom part:
Image
(I do not understand wtf is it... some kind of /Ф1 power-up?)

I labeled interconnections between groups by white text.

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Jul 11, 2012 7:19 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
More progress on ALU:
Image

_________________
6502 addict


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 15  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron