Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2528

programming • Re: CPLD Coding - Boolean vs Bitwise Operations

$
0
0
Another small change to the CPLD code. This time I've changed the way the jumpers are being used to select the PALPROMs. Basically, each of the four PALPROMs (in banks 8 thru 11) have now been assigned two adjacent jumpers to enable / disable and configure the switching zones. Basically:

Jumpers 0 & 1 are assigned to 32K PALPROM in bank 8.
Jumpers 2 & 3 are assigned to 32K PALPROM in bank 9.
Jumpers 4 & 5 are assigned to 64K PALPROM in bank 10.
Jumpers 6 & 7 are assigned to 128K PALPROM in bank 11.

This allows upto 4 different options per PALPROM bank:
11: Disabled
10: Switching zone set 1
01: Switching zone set 2
00: Switching zone set 3

Currently, only PALPROM bank 10 uses all 4 options. Banks 8 & 9 only have one switching zone set, so only use a single jumper per bank (jumper 0 & 2) and bank 11 has two.

I was able to make this fit in the CPLD, but was a bit surprised when it wouldn't fit with this logic:

Code:

always @(negedge Phi2) beginif (!nRDS && GenBankSel[10]) begin//if (RnW && GenBankSel[10]) beginif ((!bbc_nRST)     ||   (RamPALSel[5:4] == 2'b11)//Disable PALPROM switching     ||  ((RamPALSel[5:4] == 2'b10) && (bbc_ADDRESS[15:5] == 11'b1001_0011_010))//h9340..h935F (WEQST)     ||  ((RamPALSel[5:4] == 2'b01) && (bbc_ADDRESS[15:5] == 11'b1001_1111_100))//h9F80..h9F9F (WETED)     ||  ((RamPALSel[5:4] == 2'b00) && (bbc_ADDRESS[15:5] == 11'b1011_1111_100)))pp4Bank = 4'b0001;//hBF80..hBF9F (CC64K)else if (((RamPALSel[5:4] == 2'b10) && (bbc_ADDRESS[15:5] == 11'b1001_0001_111))//h91E0..h91FF (WEQST)     ||  ((RamPALSel[5:4] == 2'b01) && (bbc_ADDRESS[15:5] == 11'b1001_1111_101))//h9FA0..h9FBF (WETED)     ||  ((RamPALSel[5:4] == 2'b00) && (bbc_ADDRESS[15:5] == 11'b1011_1111_101)))pp4Bank = 4'b0010;//hBFA0..hBFBF (CC64K)else if (((RamPALSel[5:4] == 2'b10) && (bbc_ADDRESS[15:5] == 11'b1000_1000_001))//h8820..h883F (WEQST)     ||  ((RamPALSel[5:4] == 2'b01) && (bbc_ADDRESS[15:5] == 11'b1001_1111_110))//h9FC0..h9FDF (WETED)     ||  ((RamPALSel[5:4] == 2'b00) && (bbc_ADDRESS[15:5] == 11'b1011_1111_110)))pp4Bank = 4'b0100;//hBFC0..hBFDF (CC64K)else if (((RamPALSel[5:4] == 2'b10) && (bbc_ADDRESS[15:5] == 11'b1001_0010_110))//h92C0..h92DF (WEQST)     ||  ((RamPALSel[5:4] == 2'b01) && (bbc_ADDRESS[15:5] == 11'b1001_1111_111))//h9FE0..h9FFF (WETED)     ||  ((RamPALSel[5:4] == 2'b00) && (bbc_ADDRESS[15:5] == 11'b1011_1111_111)))pp4Bank = 4'b1000;//hBFE0..hBFFF (CC64K)endend
but would fit with this:

Code:

always @(negedge Phi2) beginif (!nRDS && GenBankSel[10]) begin//if (RnW && GenBankSel[10]) beginif ((!bbc_nRST)     ||  (RamPALSel[5] &&  RamPALSel[4])//Disable PALPROM switching     ||  (RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_0011_010))//h9340..h935F (WEQST)     || (!RamPALSel[5] &&  RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_1111_100))//h9F80..h9F9F (WETED)     || (!RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1011_1111_100)))pp4Bank = 4'b0001;//hBF80..hBF9F (CC64K)else if ((RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_0001_111))//h91E0..h91FF (WEQST)     || (!RamPALSel[5] &&  RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_1111_101))//h9FA0..h9FBF (WETED)     || (!RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1011_1111_101)))pp4Bank = 4'b0010;//hBFA0..hBFBF (CC64K)else if ((RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1000_1000_001))//h8820..h883F (WEQST)     || (!RamPALSel[5] &&  RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_1111_110))//h9FC0..h9FDF (WETED)     || (!RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1011_1111_110)))pp4Bank = 4'b0100;//hBFC0..hBFDF (CC64K)else if ((RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_0010_110))//h92C0..h92DF (WEQST)     || (!RamPALSel[5] &&  RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1001_1111_111))//h9FE0..h9FFF (WETED)     || (!RamPALSel[5] && !RamPALSel[4] && (bbc_ADDRESS[15:5] == 11'b1011_1111_111)))pp4Bank = 4'b1000;//hBFE0..hBFFF (CC64K)endend
Latest changes pushed to the Rev02b branch:

https://github.com/kgl2001/IntegraBv2-C ... 5144XL-100

Statistics: Posted by KenLowe — Sat Aug 24, 2024 9:33 pm



Viewing all articles
Browse latest Browse all 2528

Trending Articles