HOME

TheInfoList



OR:

Contended memory is
Sinclair Sinclair may refer to: Places * Lake Sinclair, near Milledgeville, Georgia * Sinclair, Iowa * Sinclair, West Virginia * Sinclair, Wyoming * Sinclair Mills, British Columbia * Sinclair Township, Minnesota * Sinclair, Manitoba People * ...
's name for a portion of the
ZX Spectrum The ZX Spectrum () is an 8-bit computing, 8-bit home computer that was developed by Sinclair Research. It was released in the United Kingdom on 23 April 1982, and became Britain's best-selling microcomputer. Referred to during development as t ...
's 64 KB addressable
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered, ...
space. With the full 64 KB, the
Z80 The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. The Z80 was conceived by Federico Faggin in late 1974 and developed by him and his 11 employees starting in early 1975. The first working samples were ...
microprocessor A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circu ...
is the exclusive bus master, so it reads and writes operate at its full bus speed, but contended memory space is shared between the ULA and the Z80, with the ULA having higher priority. Contended memory occupies addresses 0x4000..0x7FFF of the Z80
memory map In computer science, a memory map is a structure of data (which usually resides in memory itself) that indicates how memory is laid out. The term "memory map" can have different meanings in different contexts. *It is the fastest and most flexible ...
. This is the first 16 KB of
RAM Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
in the 48 KB machine and the entire RAM of the 16 KB machine. Contention occurs as a result of the ULA reading the display and attributes data in this RAM to produce the TV video display. Contention therefore does not occur during horizontal flyback, vertical flyback or during the screen border. Accesses to I/O also contend if the ULA must read contended memory while the Z80 accesses a ULA I/O port. ULA I/O ports are those with an even address (address bit 0 is a 0). The Z80 must wait whenever the ULA needs to access contended memory before proceeding with its own contended memory read or write. The effect to the user is that programs that make use of contended memory or contended I/O run slower than those that avoid it.


Snow Bug

The ULA must wait for a Z80 read or write to complete before it can stop the Z80's clock and access the memory; it will stop the Z80's clock only during the first
clock cycle In electronics and especially synchronous digital circuits, a clock signal (historically also known as ''logic beat'') oscillates between a high and a low state and is used like a metronome to coordinate actions of digital circuits. A clock sig ...
of a
machine cycle The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instruction ...
. Early Spectrums make the assumption that at most one contended memory access will occur in a machine cycle: this isn't true in
instruction fetch The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instruction ...
cycles if the
programmer A computer programmer, sometimes referred to as a software developer, a software engineer, a programmer or a coder, is a person who creates computer programs — often for larger computer software. A programmer is someone who writes/creates ...
has configured the
interrupt vector table An interrupt vector table (IVT) is a data structure that associates a list of interrupt handlers with a list of interrupt requests in a table of interrupt vectors. Each entry of the interrupt vector table, called an interrupt vector, is the addr ...
to fall within the contended area. In that case the ULA will decline to load its
video Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. Video was first developed for mechanical television systems, which were quickly replaced by cathode-ray tube (CRT) syste ...
address and the video
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
displayed will be whatever the processor was reading. The consequence of this is random
noise Noise is unwanted sound considered unpleasant, loud or disruptive to hearing. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrations through a medium, such as air or water. The difference arise ...
on the display, or 'snow'. Since this effect did not occur under normal operation — it required a programmer's deliberate intervention — it was very seldom seen, being used only in some
games A game is a structured form of play, usually undertaken for entertainment or fun, and sometimes used as an educational tool. Many games are also considered to be work (such as professional players of spectator sports or games) or art (such ...
small>''which ones?''as a special graphical effect. Later versions of the Spectrum, including all 128kb versions, correct the bug.


Circuit

The ULA does not use the Z80's bus request/grant mechanism to become bus master during its contended memory accesses. Instead, it extends the high period of the Z80 clock input to stop all microprocessor activity. While this is less elegant than performing a bus request, it does gain contended memory access to fewer Z80 clocks. This removes any need for the ULA to read display data in advance, a benefit with the crowded circuitry in the full ULA. The ULA connects directly to the memory system ICs while the Z80 connects to them through isolating series current-limit resistors. This allows the ULA and memory to drive each other while the Z80 is also driving the memory. Using resistors instead of tristate bus driver ICs reduces the expense of the circuit but does take a higher average I/O pin current from the Z80, ULA and memory ICs.


References


External links


Contended Memory
on Sinclair FAQ Wiki

on worldofspectrum.org
Contended Memory
on zxdesign.info {{DEFAULTSORT:Ciontended memory, ZX Spectrum ZX Spectrum