Learn R Programming

adana (version 1.1.0)

gray2bin: Convert gray code to binary integer #1

Description

The function gray2bin converts gray coded integer to a binary coded number.

Usage

gray2bin(gray)

Arguments

gray

A gray coded number.

Value

Returns the binary coded integer equivalent of the input number.

Details

The gray2bin function works as a compliment of the bin2gray function.

See Also

bin2gray, gray2bin2

Examples

Run this code
# NOT RUN {
gray = c(1,1,1,0)
gray2bin(gray)       # returns 1011
gray = c(1,1,1,1)
gray2bin(gray)       # returns 1010
# }

Run the code above in your browser using DataLab