bin2gray {adana}R Documentation

Convert from binary to gray code integer

Description

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

Usage

bin2gray(bin)

Arguments

bin

A binary coded number.

Details

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

Value

Returns the gray coded integer equivalent of the input number.

Author(s)

Zeynel Cebeci & Erkut Tekeli

See Also

gray2bin

Examples

  bin = c(1,0,1,1)
  bin2gray(bin)     # returns 1110
  
  bin = c(1,0,1,0)
  bin2gray(bin)     # returns 1111

[Package adana version 1.1.0 Index]