Keil Logo

Address Decoding

The 20V8 PAL (IC12) performs all memory address decode logic and other signal conversions. Following is a listing of the PAL equations.

;PALASM Design Description
;---------------------------------- Declaration Segment ------------
TITLE    GAL for MCBx51 Prototype board
PATTERN  Decoder and Boot Logic
REVISION 2.1
COMPANY  Keil Elektronik GmbH
DATE     10/06/2000
CHIP  IC6  PALCE20V8
;---------------------------------- PIN Declarations ---------------
PIN  1          LED                 COMBINATORIAL ; INPUT
PIN  2          RST                 COMBINATORIAL ; INPUT
PIN  3          /PSEN               COMBINATORIAL ; INPUT
PIN  4..11      A[10..17]           COMBINATORIAL ; INPUT
PIN  12         GND                               ; INPUT
PIN  13         /MAP[0]             COMBINATORIAL ; INPUT
PIN  14         /MON_ON             COMBINATORIAL ; INPUT
PIN  15         /RD_RAM             COMBINATORIAL ; OUTPUT
PIN  16         MON_RUN             COMBINATORIAL ; OUTPUT
PIN  17         /CS_USER            COMBINATORIAL ; OUTPUT
PIN  18         A16_ROM             COMBINATORIAL ; OUTPUT
PIN  19         A16_RAM             COMBINATORIAL ; OUTPUT
PIN  20         /CS_UART            COMBINATORIAL ; OUTPUT
PIN  21         /CS_ROM             COMBINATORIAL ; OUTPUT
PIN  22         CS_RAM              COMBINATORIAL ; OUTPUT
PIN  23         /MAP[1]             COMBINATORIAL ; INPUT
PIN  24         VCC                               ; INPUT


;----------------------------------- Boolean Equation Segment ------
EQUATIONS
IF (MON_ON) THEN                    ; Monitor switched on
  BEGIN
    A16_ROM = LED
    IF (MAP[1..0] = #b11) THEN
      BEGIN
        RD_RAM  = PSEN + /A[16]      ; 8051 Mode
        A16_RAM = 0;
      END
    ELSE
      BEGIN
        RD_RAM  = PSEN
        A16_RAM = A[16]
      END
    IF (MON_RUN) THEN
      BEGIN
        MON_RUN = /RST
        IF (MAP[1..0] = #b11) THEN            ; 8051 Mode ?
          BEGIN
            CS_RAM = /(A[15] * A[14] * A[13]) ; Address 0–dfff
            CS_ROM =  A[15] *  A[14] * A[13] * /A[12] *  A[11] + ; Address e800-efff
            CS_ROM =  /CS_RAM * /CS_UART * /CS_USER     ; Address e800 – efff
          END
        ELSE
          BEGIN
            CS_RAM = /(A[17] * A[16] *  A[15] * A[14] * A[13]) ; Address 0 - 3dfff
            CS_ROM =  /CS_RAM * /CS_UART * /CS_USER  ; Address 3e800 - 3efff
          END
      END
    ELSE
      BEGIN
        CS_ROM = 1                            ; ROM always enabled
        CS_RAM = 0                            ; RAM always disabled
        IF (A[17..10] = #b11111010) THEN      ; Address 3e800 - 3ebff
          BEGIN
            MON_RUN = PSEN * /RST
          END
        ELSE
          BEGIN
            MON_RUN = 0
          END
      END
  END
ELSE                                ; Monitor switched off
  BEGIN
    CASE (MAP[1..0])
      BEGIN
      0: BEGIN
         CS_RAM  =/(A[17] * A[16])                         ; RAM 00000 - 2ffff
         CS_ROM  =  A[17] * A[16] * /CS_UART * /CS_USER    ; ROM 30000 - 3dfff
         A16_ROM =  A[16]
         A16_RAM =  A[16]
         RD_RAM  =  PSEN
         END
      1: BEGIN
         CS_RAM  = /A[17]                           ; RAM 00000 - 1ffff
         CS_ROM  =  A[17] * /CS_UART * /CS_USER     ; ROM 20000 - 3dfff
         A16_ROM =  A[16]
         A16_RAM =  A[16]
         RD_RAM  =  PSEN
         END
      2: BEGIN
         CS_RAM  = /A[17] * /A[16] * /A[15]         ; RAM 0000 - 07FFF
         CS_ROM  = /CS_RAM * /CS_UART * /CS_USER    ; ROM 08000 - 3dfff
         A16_ROM = A[16]                            ; ROM 3e800 - 3ffff
         A16_RAM = A[16]
         RD_RAM  = PSEN
         END
      3: BEGIN                               ; 8051 Mode
         CS_RAM = /(A[15] * A[14] * A[13])   ; RAM 00000 - 0dfff  8051 Mode
         CS_ROM  = 1;                        ; ROM 00000 - 0ffff
         A16_ROM = 0
         A16_RAM = 0
         RD_RAM  = /A[16]
         END
      END

  END

IF (MAP[1..0] = #b11) THEN                    ; 8051 Mode?
  BEGIN
    IF (A[15..10] = #b111000) THEN            ; ADDRESS e000 - e3ff
      BEGIN
        CS_USER = 1
      END
    ELSE
      BEGIN
        CS_USER = 0
      END

    IF (A[15..10] = #b111001) THEN            ; ADDRESS e400 - e7ff
      BEGIN
        CS_UART = 1
      END
    ELSE
      BEGIN
        CS_UART = 0
      END
  END
ELSE
  BEGIN
    IF (A[17..10] = #b11111000) THEN            ; ADDRESS 3e000 - 3e3ff
      BEGIN
        CS_USER = 1
      END
    ELSE
      BEGIN
        CS_USER = 0
      END

    IF (A[17..10] = #b11111001) THEN            ; ADDRESS 3e400 - 3e7ff
      BEGIN
        CS_UART = 1
      END
    ELSE
      BEGIN
        CS_UART = 0
      END
  END

;-------------------------------------------------------------------

Related Knowledgebase Articles

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.