Computer arithmetic

Two-out-of-five code

A two-out-of-five code is a constant-weight code that provides exactly ten possible combinations of two bits, and is thus used for representing the decimal digits using five bits. Each bit is assigned a weight, such that the set bits sum to the desired value, with an exception for zero. According to Federal Standard 1037C: * each decimal digit is represented by a binary numeral consisting of five bits of which two are of one kind, called ones, and three are of the other kind, called zeros, and * the usual weights assigned to the bit positions are 0-1-2-3-6. However, in this scheme, zero is encoded as binary 01100; strictly speaking the 0-1-2-3-6 previously claimed is just a mnemonic device. The weights give a unique encoding for most digits, but allow two encodings for 3: 0+3 or 10010 and 1+2 or 01100. The former is used to encode the digit 3, and the latter is used to represent the otherwise unrepresentable zero. The IBM 7070, IBM 7072, and IBM 7074 computers used this code to represent each of the ten decimal digits in a machine word, although they numbered the bit positions 0-1-2-3-4, rather than with weights. Each word also had a sign flag, encoded using a two-out-of-three code, that could be A Alphanumeric, − Minus, or + Plus. When copied to a digit, the three bits were placed in bit positions 0-3-4. (Thus producing the numeric values 3, 6 and 9, respectively.) A variant is the United States Postal Service POSTNET barcode, used to represent the ZIP Code for automated mail sorting and routing equipment. This uses two tall bars as ones and three short bars as zeros. Here, the weights assigned to the bit positions are 7-4-2-1-0. Again, zero is encoded specially, using the 7+4 combination (binary 11000) that would naturally encode 11. This method was also used in North American telephone multi-frequency and crossbar switching systems. The USPS Postal Alpha Numeric Encoding Technique (PLANET) uses the same weights, but with the opposite bar-height convention. The Code 39 barcode uses weights 1-2-4-7-0 (i.e. LSB first, Parity bit last) for the widths of its bars, but it also encodes two bits of extra information in the spacing between bars. The || ||| spacing is used for digits. The following table represents decimal digits from 0 to 9 in various two-out-of-five code systems: The limit on the number of bits set is similar to, but strictly stronger than, a parity check. All constant-weight codes, including the two-out-of-five code, can not only detect any single-bit error, but also detect any unidirectional errors -- any case where all errors in a codeword are of a single type (0→1 or 1→0). (Wikipedia).

Two-out-of-five code
Video thumbnail

Ex: Linear Equation Application with One Variable - Number Problem

This video provides and example of how to solve a number problem using a linear equation with one variable. One number is a multiple of the other. The difference is a constant. Find the two numbers. Library: http://mathispower4u.com Search: http://mathispower4u.wordpress.com

From playlist Whole Number Applications

Video thumbnail

Ordered Selections (3 of 3: Considering conditions)

More resources available at www.misterwootube.com

From playlist Working with Combinatorics

Video thumbnail

Divisibility Rules

This video covers the divisibility rules for 2,3,4,5,6,8,9,and 10. http://mathispower4u.yolasite.com/

From playlist Factors, Prime Factors, and Least Common Factors

Video thumbnail

Decimal to BCD

This number systems video tutorial explains how to convert from decimal to BCD or binary coded decimal. Subscribe: https://www.youtube.com/channel/UCEWpbFLzoYGPfuWUMFPSaoA?sub_confirmation=1 Access to Premium Videos: https://www.patreon.com/MathScienceTutor https://www.facebook.com/Math

From playlist Number Systems

Video thumbnail

Counting: Find the Number of 5-Digit Numbers Under Various Conditions

This video explains how to determine how many 5-digit numbers are possible under various conditions.

From playlist Counting (Discrete Math)

Video thumbnail

Multiplying Decimals

"Multiply decimal numbers."

From playlist Number: Decimals

Video thumbnail

Ex: Determine a Number that is Less Than and Greater than Using a Specific Place Value

This video provides examples of how to find a number that is less than and greater than a given number using a specific place value. Search Video Library at http://www.mathispower4u.wordpress.com

From playlist Whole Numbers: Place Value and Writing Numbers

Video thumbnail

Ex 1: Determine What Two Decimals a Given Number is Between

This video provides and example of how to determine what a given number is between to specific place value Library: http://mathispower4u.com Search: http://mathispower4u.wordpress.com

From playlist Introduction to Decimals

Video thumbnail

Stanford Lecture: Donald Knuth—"Universal Commafree Codes" (2015)

Donald Knuth's 21st Annual Christmas Lecture: Universal Commafree Codes December 3, 2015 A commafree code is a set of codewords that can be read easily without spaces or other delimiters between words. In 1965, Willard Eastman discovered a beautiful but underappreciated way to construct

From playlist Donald Knuth Lectures

Video thumbnail

Year 12/AS Statistics Chapter 2.5 (Measures of Location & Spread)

In this final lesson about measures of location and spread for year 12, we introduce the idea of coding data to make sets of data easier to deal with. I then explain how to "uncode" the data later so that statistics for the original data can be calculated from coded versions. This lesson

From playlist Year 12/AS Edexcel (8MA0) Mathematics: FULL COURSE

Video thumbnail

Correcting Those Errors - Computerphile

The powers of two and the algorithm that helps them correct errors. Professor Brailsford explains how to fix those one-bit blips. EXTRA BITS: https://youtu.be/e_JuNuJnvjI More about these codes in this video - Multiple Dimension Error Correction: https://www.youtube.com/watch?v=1_X-7B

From playlist Subtitled Films

Video thumbnail

Processing Foundation Holiday Telethon 2020

#SupportP5 is a month-long online fundraising campaign to support and help sustain our software projects, our Fellowship program, Processing Community Day, and our other education initiatives. https://donorbox.org/supportp52020 💻https://editor.p5js.org/codingtrain/sketches/JCidTJu7c 🎶htt

From playlist Live Stream Archive

Video thumbnail

Puzzle 3: You Can Read Minds (with a little calibration)

MIT 6.S095 Programming for the Puzzled, IAP 2018 View the complete course: https://ocw.mit.edu/6-S095IAP18 Instructor: Srini Devadas Prof. Devadas describes a mind reading trick that allows you to guess the fifth card that the audience thinks of, after you "fail" on the first four! With a

From playlist MIT 6.S095 Programming for the Puzzled, January IAP 2018

Video thumbnail

Math for Liberal Studies - Lecture 3.4.1 POSTNET Bar Codes

This is the first video for Math for Liberal Studies Section 3.4: Bar Codes. In this video, I discuss different kinds of bar codes, focusing on the POSTNET code, which was used on US mail until 2013. This code uses a pattern of tall and short bars that can be used to encode ZIP code inform

From playlist Math for Liberal Studies Lectures

Video thumbnail

Little Man Computer: 3. Loops

Little Man Computer is a model of a computer that was created to help students of computer science learn about assembly language programming and the Von Neumann Architecture. In this computer science lesson, you will learn how to write looping code, that is, you will learn how to make a b

From playlist Computer Hardware and Architecture

Video thumbnail

Grading and Assessment

Doug discusses the CS50 grading philosophy and guides teachers through some practice exercises.

From playlist CS50 AP Cambridge Workshop 2016

Video thumbnail

Numbers in Words

"Put worded numbers into figures or vice versa."

From playlist Number: Basic Arithmetic

Video thumbnail

EEVblog 1531 - Can ChatGPT generate all the code for my Macgyver Project? (Part 3)

Can ChatGPT generate all the code for my Macgyver Project? Does ChatGPT understand what 7 segment displays and shift registers are, and can it integrate that knowledge with Arduino programming? Let's find out! This is Part 3 of the Magyver project. Part 1: https://www.youtube.com/watch?v=

From playlist MacGyver Project

Related pages

Constant-weight code | Decimal | Numerical digit | Parity bit | Bi-quinary coded decimal | Least significant bit | Bit