Misplaced Pages

COSMAC ELF

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

The COSMAC Elf was an RCA 1802 microprocessor-based computer described in a series of construction articles in Popular Electronics magazine in 1976 and 1977. Through the back pages of electronics magazines, both Netronics and Quest Electronics offered low-priced, enhanced kits that were based on this design. The system was a very early single-board personal computer . It was operated without built-in ROMs and programs were entered directly with help of the CPU integrated DMA using 8 toggle switches and an Input push button.

#255744

53-400: It featured two hexadecimal LED displays for byte data value output and a set of 8 toggle switches for input. (a hexadecimal keypad was an optional extension) The base configuration had 256 bytes of RAM , but expansion projects could raise that to a power of two-based memory store, with an upper limit of 64K address space . The original Elf design used a crystal with a frequency in

106-593: A cassette recorder , and for serial I/O output. Branch instructions in the 1802 instruction set could read the state of the EF1 through EF4 single bit value input lines, which were used to read the 'I' keypad (input) momentary pushbutton (typically EF4), programs from the cassette recorder through interface circuitry, serial I/O input, and input from peripherals such as a light pen . There are also seven 8-bit I/O ports available for decoding and interfacing. The original Elf computers were essentially home-built versions of

159-590: A 1.76 MHz clock, and since that was an uncommon crystal frequency, usually a readily available 3.579545 MHz colorburst crystal was instead used in a separate oscillator circuit with a divide-by-two circuit to drive the clock inputs of both the microprocessor and Pixie. The resulting 1.7897725 MHz clock was close enough for the hardware to work. Monochrome video output (with timing roughly approximating NTSC standard) could be generated using DMA operations interleaved with carefully arranged 1802 opcodes as instructions in software. The maximum resolution of

212-496: A 32-bit CPU register (in two's complement ), as C228 0000 in a 32-bit FPU register or C045 0000 0000 0000 in a 64-bit FPU register (in the IEEE floating-point standard ). Just as decimal numbers can be represented in exponential notation , so too can hexadecimal numbers. P notation uses the letter P (or p , for "power"), whereas E (or e ) serves a similar purpose in decimal E notation . The number after

265-531: A brand of mints , sold primarily in distinctive metal tins. The brand was created by the London -based Smith & Company in the 1780s, and became part of the Callard & Bowser company in the 19th century. Their advertising slogan is "The Original Celebrated Curiously Strong Mints", referring to the high concentration of peppermint oil used in the original flavour lozenge. The mints were originally conceived as

318-409: A convenient representation of binary-coded values. Each hexadecimal digit represents four bits (binary digits), also known as a nibble (or nybble). For example, a 6-bit byte can have values ranging from 000000 to 111111 (0 to 63 decimal) in binary form, which can be written as 00 to 3F in hexadecimal. In mathematics, a subscript is typically used to specify the base. For example,

371-688: A larger 2.3 oz tin instead of the standard 1.76 oz sours tins that had been released up until then. The sugar-free chewing gum , introduced in 2003, was made in the United States . Flavors include peppermint, cinnamon, spearmint, wintergreen and two sour flavours, cherry and apple. The gum has not been seen in stock in US stores since January 2010 and has been discontinued. In 2003, breath strips in peppermint and cinnamon flavors were introduced. They were discontinued. In 2014, Eclipse Mints , another Wrigley product, were rebranded as Altoids Arctic, with

424-403: A larger proportion lies outside its range of finite representation. All rational numbers finitely representable in hexadecimal are also finitely representable in decimal, duodecimal and sexagesimal : that is, any hexadecimal number with a finite number of digits also has a finite number of digits when expressed in those other bases. Conversely, only a fraction of those finitely representable in

477-546: A lozenge intended to relieve intestinal discomfort. Callard & Bowser-Suchard once manufactured Altoids at a plant in Bridgend , Wales , but has since moved production to a Mars Wrigley plant in Chattanooga, Tennessee , United States, in order to manufacture the products closer to where they are primarily marketed. They were marketed for a brief period in the 1990s under the "Nuttall's" brand when Callard and Bowser

530-482: A pair of quaternary digits, and each quaternary digit corresponds to a pair of binary digits. In the above example 2 5 C 16 = 02 11 30 4 . The octal (base 8) system can also be converted with relative ease, although not quite as trivially as with bases 2 and 4. Each octal digit corresponds to three binary digits, rather than four. Therefore, we can convert between octal and hexadecimal via an intermediate conversion to binary followed by regrouping

583-402: A relatively small binary number. Although most humans are familiar with the base 10 system, it is much easier to map binary to hexadecimal than to decimal because each hexadecimal digit maps to a whole number of bits (4 10 ). This example converts 1111 2 to base ten. Since each position in a binary numeral can contain either a 1 or a 0, its value may be easily determined by its position from

SECTION 10

#1732791433256

636-510: A single hexadecimal digit. This example shows the conversion of a binary number to decimal, mapping each digit to the decimal value, and adding the results. Compare this to the conversion to hexadecimal, where each group of four digits can be considered independently and converted directly: The conversion from hexadecimal to binary is equally direct. Although quaternary (base 4) is little used, it can easily be converted to and from hexadecimal or binary. Each hexadecimal digit corresponds to

689-414: A variety of methods have arisen: Sometimes the numbers are known to be Hex. The use of the letters A through F to represent the digits above 9 was not universal in the early history of computers. Since there were no traditional numerals to represent the quantities from ten to fifteen, alphabetic letters were re-employed as a substitute. Most European languages lack non-decimal-based words for some of

742-408: Is a positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbols, hexadecimal uses sixteen distinct symbols, most often the symbols "0"–"9" to represent values 0 to 9 and "A"–"F" to represent values from ten to fifteen. Software developers and system designers widely use hexadecimal numbers because they provide

795-477: Is a modern, simple COSMAC Elf-like remake for retrocomputing hobbyists that is designed to fit in an Altoids tin. Various other hobbyist systems can be found on the Internet, including hardware emulators using FPGA and modern microcontrollers . A series of newsletters and small booklets offered by Netronics and Quest contained 1802 machine language and CHIP-8 programs, along with schematics for expanding

848-464: Is deliberately shaped with rounded corners to fit inside the tin. A retrocomputing hobbyist computer, the Membership Card is a series of 1802/8080/Z80 based microcomputer kits, designed to fit in an Altoids tin, and CMoy pocket headphone amplifiers often use the containers as an enclosure. The minty Pi is a kit that uses an Altoids tin to house a portable retro gaming machine. At

901-444: Is illustrated on the right. The hexadecimal system can express negative numbers the same way as in decimal: −2A to represent −42 10 , −B01D9 to represent −721369 10 and so on. Hexadecimal can also be used to express the exact bit patterns used in the processor , so a sequence of hexadecimal digits may represent a signed or even a floating-point value. This way, the negative number −42 10 can be written as FFFF FFD6 in

954-454: Is much more advisable to work with bitwise operators . It is also possible to make the conversion by assigning each place in the source base the hexadecimal representation of its place value — before carrying out multiplication and addition to get the final representation. For example, to convert the number B3AD to decimal, one can split the hexadecimal number into its digits: B (11 10 ), 3 (3 10 ), A (10 10 ) and D (13 10 ), and then get

1007-562: Is some standardization of using spaces (rather than commas or another punctuation mark) to separate hex values in a long list. For instance, in the following hex dump , each 8-bit byte is a 2-digit hex number, with spaces between them, while the 32-bit offset at the start is an 8-digit hex number. In contexts where the base is not clear, hexadecimal numbers can be ambiguous and confused with numbers expressed in other bases. There are several conventions for expressing values unambiguously. A numerical subscript (itself written in decimal) can give

1060-502: The C99 edition of the C programming language . Using the %a or %A conversion specifiers, this notation can be produced by implementations of the printf family of functions following the C99 specification and Single Unix Specification (IEEE Std 1003.1) POSIX standard. Most computers manipulate binary data, but it is difficult for humans to work with a large number of digits for even

1113-576: The COSMAC VIP . In August 2006, Nuts and Volts magazine, along with Spare Time Gizmos , released a project to build the "Cosmac Elf 2000," based on the original Elf, with some newer and easier to find components and enhanced features, modules, and functionality, including the STG1861 Pixie Graphics Replacement board that is functionally equivalent to the now-rare RCA CDP1861 integrated circuit. The Membership Card

SECTION 20

#1732791433256

1166-667: The Calculator utility can be set to Programmer mode, which allows conversions between radix 16 (hexadecimal), 10 (decimal), 8 ( octal ), and 2 ( binary ), the bases most commonly used by programmers. In Programmer Mode, the on-screen numeric keypad includes the hexadecimal digits A through F, which are active when "Hex" is selected. In hex mode, however, the Windows Calculator supports only integers. Elementary operations such as division can be carried out indirectly through conversion to an alternate numeral system , such as

1219-454: The P is decimal and represents the binary exponent. Increasing the exponent by 1 multiplies by 2, not 16: 20p0 = 10p1 = 8p2 = 4p3 = 2p4 = 1p5 . Usually, the number is normalized so that the hexadecimal digits start with 1. (zero is usually 0 with no P ). Example: 1.3DEp42 represents 1.3DE 16  × 2 . P notation is required by the IEEE 754-2008 binary floating-point standard and can be used for floating-point literals in

1272-603: The RCA Microkit, Microtutor I and Microtutor II, which were RCA's demonstration boards for their CDP1801 2-chip predecessor and single-chip CDP1802 microprocessors. Enhanced kits such as the Netronics Elf II and Quest Super Elf added built-in features such as keypads for data entry, serial I/O, cassette interface, and the CDP1861 "Pixie" video chip. RCA later introduced their own similarly expanded version as

1325-491: The duodecimal system, there have been occasional attempts to promote hexadecimal as the preferred numeral system. These attempts often propose specific pronunciation and symbols for the individual numerals. Some proposals unify standard measures so that they are multiples of 16. An early such proposal was put forward by John W. Nystrom in Project of a New System of Arithmetic, Weight, Measure and Coins: Proposed to be called

1378-492: The 1861 was 64h by 128v rectangular pixels. By changing the placement of instructions in the video display control and interrupt routines, pixel rows could be repeated to obtain lower resolutions, allowing the video display to be used with 256 bytes of RAM (64×32 square pixels ). A one-bit output from the microprocessor, the Q line, could be driven by software to produce sounds through an attached speaker, to save programs in RAM to

1431-634: The COSMAC Elf 2000. Other languages available are noted at the RCA 1802 Misplaced Pages entry, including interpreters , compilers and assemblers . Game cartridges for the RCA Studio II contain Chip-8 games, which can run on other 1802 systems. File dumps of these games can be found on the Internet. Construction Articles Hexadecimal Hexadecimal (also known as base-16 or simply hex )

1484-473: The Elf and adding peripherals, including a light pen. Other, similar information and hobbyist software projects can be found on the Internet. The only published book about the 1802 is Tom Swan's "Programmer’s Guide to the 1802" (1981), which has been made available as a PDF after being out of print for many years. Tiny BASIC, a version of BASIC offered by Tom Pittman, could be used to write small BASIC programs on

1537-567: The Elf that could display through the Pixie low-resolution monochrome graphics display or TV-Typewriter hardware. Pittman also wrote a small booklet about the 1802 titled "A Short Course In Programming", which he has allowed to be published and made available online free of charge. Mike Riley has written an editor, assembler, BASIC and FORTH interpreters, a BIOS , and the Elf/OS disk operating system that will run on expanded Elf systems, including

1590-550: The Tonal System, with Sixteen to the Base , published in 1862. Nystrom among other things suggested hexadecimal time , which subdivides a day by 16, so that there are 16 "hours" (or "10 tims ", pronounced tontim ) in a day. The word hexadecimal is first recorded in 1952. It is macaronic in the sense that it combines Greek ἕξ (hex) "six" with Latinate -decimal . The all-Latin alternative sexadecimal (compare

1643-507: The base explicitly: 159 10 is decimal 159; 159 16 is hexadecimal 159, which equals 345 10 . Some authors prefer a text subscript, such as 159 decimal and 159 hex , or 159 d and 159 h . Donald Knuth introduced the use of a particular typeface to represent a particular radix in his book The TeXbook . Hexadecimal representations are written there in a typewriter typeface : 5A3 , C1F27ED In linear text systems, such as those used in most computer programming environments,

COSMAC ELF - Misplaced Pages Continue

1696-451: The binary digits in groups of either three or four. As with all bases there is a simple algorithm for converting a representation of a number to hexadecimal by doing integer division and remainder operations in the source base. In theory, this is possible from any base, but for most humans, only decimal and for most computers, only binary (which can be converted by far more efficient methods) can be easily handled with this method. Let d be

1749-400: The commonly used decimal system or the binary system where each hex digit corresponds to four binary digits. Alternatively, one can also perform elementary operations directly within the hex system itself — by relying on its addition/multiplication tables and its corresponding standard algorithms such as long division and the traditional subtraction algorithm. As with other numeral systems,

1802-440: The decimal value 711 would be expressed in hexadecimal as 2C7 16 . In programming, several notations denote hexadecimal numbers, usually involving a prefix. The prefix 0x is used in C , which would denote this value as 0x2C7 . Hexadecimal is used in the transfer encoding Base 16 , in which each byte of the plain text is broken into two 4-bit values and represented by two hexadecimal digits. In most current use cases,

1855-576: The end of the 1960s. In 1969, Donald Knuth argued that the etymologically correct term would be senidenary , or possibly sedenary , a Latinate term intended to convey "grouped by 16" modelled on binary , ternary , quaternary , etc. According to Knuth's argument, the correct terms for decimal and octal arithmetic would be denary and octonary , respectively. Alfred B. Taylor used senidenary in his mid-1800s work on alternative number bases, although he rejected base 16 because of its "incommodious number of digits". Altoids Altoids are

1908-450: The expansions of some common irrational numbers in decimal and hexadecimal. Powers of two have very simple expansions in hexadecimal. The first sixteen powers of two are shown below. The traditional Chinese units of measurement were base-16. For example, one jīn (斤) in the old system equals sixteen taels . The suanpan (Chinese abacus ) can be used to perform hexadecimal calculations such as additions and subtractions. As with

1961-455: The final result by multiplying each decimal representation by 16 ( p being the corresponding hex digit position, counting from right to left, beginning with 0). In this case, we have that: B3AD = (11 × 16 ) + (3 × 16 ) + (10 × 16 ) + (13 × 16 ) which is 45997 in base 10. Many computer systems provide a calculator utility capable of performing conversions between the various radices frequently including hexadecimal. In Microsoft Windows ,

2014-454: The hexadecimal system can be used to represent rational numbers , although repeating expansions are common since sixteen (10 16 ) has only a single prime factor: two. For any base, 0.1 (or "1/10") is always equivalent to one divided by the representation of that base value in its own number system. Thus, whether dividing one by two for binary or dividing one by sixteen for hexadecimal, both of these fractions are written as 0.1 . Because

2067-424: The ingredients of their wintergreen mints, adding blue food colouring. Altoid mints other than those labelled "sugar-free smalls" contain gelatin . Sour hard candies in round tins were introduced in 2001 but were discontinued in 2010 due to low sales. Flavours included raspberry , citrus , apple , tangerine , and mango . Limited edition passion fruit sours were also released around Valentine's Day in 2005 in

2120-421: The latter bases are finitely representable in hexadecimal. For example, decimal 0.1 corresponds to the infinite recurring representation 0.1 9 in hexadecimal. However, hexadecimal is more efficient than duodecimal and sexagesimal for representing fractions with powers of two in the denominator. For example, 0.0625 10 (one-sixteenth) is equivalent to 0.1 16 , 0.09 12 , and 0;3,45 60 . The table below gives

2173-437: The letters A–F or a–f represent the values 10–15, while the numerals 0–9 are used to represent their decimal values. There is no universal convention to use lowercase or uppercase, so each is prevalent or preferred in particular environments by community standards or convention; even mixed case is used. Some seven-segment displays use mixed-case 'A b C d E F' to distinguish the digits A–F from one another and from 0–9. There

COSMAC ELF - Misplaced Pages Continue

2226-484: The number to represent in hexadecimal, and the series h i h i−1 ...h 2 h 1 be the hexadecimal digits representing the number. "16" may be replaced with any other base that may be desired. The following is a JavaScript implementation of the above algorithm for converting any number to a hexadecimal in String representation. Its purpose is to illustrate the above algorithm. To work with data seriously, however, it

2279-553: The numerals eleven to fifteen. Some people read hexadecimal numbers digit by digit, like a phone number, or using the NATO phonetic alphabet , the Joint Army/Navy Phonetic Alphabet , or a similar ad-hoc system. In the wake of the adoption of hexadecimal among IBM System/360 programmers, Magnuson (1968) suggested a pronunciation guide that gave short names to the letters of hexadecimal – for instance, "A"

2332-598: The radix 16 is a perfect square (4 ), fractions expressed in hexadecimal have an odd period much more often than decimal ones, and there are no cyclic numbers (other than trivial single digits). Recurring digits are exhibited when the denominator in lowest terms has a prime factor not found in the radix; thus, when using hexadecimal notation, all fractions with denominators that are not a power of two result in an infinite string of recurring digits (such as thirds and fifths). This makes hexadecimal (and binary) less convenient than decimal for representing rational numbers since

2385-527: The range of 1 to 2 MHz with the 1802's built in oscillator circuit. A simple circuit used the DMA feature of the 1802 to permit entry of programs and data into RAM through the toggle switches. Entering a byte via the toggle switches and pressing the "input" button would enter a byte into RAM and display it on the pair of hex LEDs, then advance the DMA counter to the next location. A "memory protect" switch could be used to disable memory alteration. If an error

2438-428: The right: Therefore: With little practice, mapping 1111 2 to F 16 in one step becomes easy (see table in written representation ). The advantage of using hexadecimal rather than decimal increases rapidly with the size of the number. When the number becomes large, conversion to decimal is very tedious. However, when mapping to hexadecimal, it is trivial to regard the binary string as 4-digit groups and map each to

2491-585: The tin remaining identical save for labelling. The rebranded mints were released in only Peppermint, Wintergreen, and Strawberry, doing away with the wider varieties of Eclipse such as Cinnamon, Winterfrost, and several other flavors, as well as the chewable. As before, each tin contains 1.2 oz (34g), or about 50 mints. The distinctive tins in which Altoids mints are packaged are often reused for other purposes. They have long been used as containers for household items like paper clips, coins, sewing materials and other small items. Many people make "Altoids Wallets" out of

2544-428: The tins. Some have gotten very creative decorating the inside with pictures of their favorite artists, etc. Altoids tins have also been popular with outdoor enthusiasts for many years as first-aid or mini survival kit containers. A name for these kits is Bug-Out Altoids Tins , or BOATs . The tins are sometimes used to house electronics projects. BeagleBone , a single-board computer made by Texas Instruments ,

2597-596: The verbal Morse Code conventions to express four-bit hexadecimal digits, with "dit" and "dah" representing zero and one, respectively, so that "0000" is voiced as "dit-dit-dit-dit" (....), dah-dit-dit-dah (-..-) voices the digit with a value of nine, and "dah-dah-dah-dah" (----) voices the hexadecimal digit for decimal 15. Systems of counting on digits have been devised for both binary and hexadecimal. Arthur C. Clarke suggested using each finger as an on/off bit, allowing finger counting from zero to 1023 10 on ten fingers. Another system for counting up to FF 16 (255 10 )

2650-774: The word sexagesimal for base 60) is older, and sees at least occasional use from the late 19th century. It is still in use in the 1950s in Bendix documentation. Schwartzman (1994) argues that use of sexadecimal may have been avoided because of its suggestive abbreviation to sex . Many western languages since the 1960s have adopted terms equivalent in formation to hexadecimal (e.g. French hexadécimal , Italian esadecimale , Romanian hexazecimal , Serbian хексадецимални , etc.) but others have introduced terms which substitute native words for "sixteen" (e.g. Greek δεκαεξαδικός, Icelandic sextándakerfi , Russian шестнадцатеричной etc.) Terminology and notation did not become settled until

2703-460: Was made in program entry, it could be corrected by turning on memory protect, turning off load mode (thus resetting the program counter to zero), turning on load mode, and pressing "input" to advance to the address of the incorrect data. After turning off memory protect, the correct value could be entered. The fourth article of the series presented modifications to use a companion RCA 1861 “Pixie” video generator IC (CDP1861). The Pixie required

SECTION 50

#1732791433256

2756-470: Was pronounced "ann", B "bet", C "chris", etc. Another naming-system was published online by Rogers (2007) that tries to make the verbal representation distinguishable in any case, even when the actual number does not contain numbers A–F. Examples are listed in the tables below. Yet another naming system was elaborated by Babb (2015), based on a joke in Silicon Valley . Others have proposed using

2809-766: Was under the ownership of Terry's . As of June 2022 , Altoids mints are available in five flavours, namely peppermint , wintergreen , spearmint , cinnamon , and strawberry . "Sugar-Free Smalls", tiny square mints sweetened with sorbitol and sucralose , are also available in peppermint, wintergreen, and cinnamon. In 2007, dark chocolate -dipped mints were introduced in three flavours, namely peppermint, cinnamon and ginger and in 2008, dark chocolate-dipped mints were introduced in crème de menthe . The chocolate-dipped varieties were discontinued in 2010. Also historically made, but no longer available, were liquorice , cool honey , and (non-chocolate dipped) ginger and crème de menthe varieties. Circa early 2011, Altoids altered

#255744