**a) How many data bits are required to store one of the decimal digits 0 through 9?**

**Ans) 4 bits needed to represent decimal 0-9**

**Explanation:-**

**0 –> 0000 1 –> 0001 2–> 0010 3 –>>0011 4 –>0100 5–>0101 **

**6 –> 0110 7 –> 0111 8 –> 1000 9 –>1001**

**—————————————————————————————————————–**

**b) How many parity bits are required to correct a single error?**

**Ans) 3 bit**

**Explanation:-**

**we are using formulae 2**^{r} >=d+r+1

**where,r=number of parity bit and d=number of data bits**

**Here, 2**^{3} >= 4+3+1

**—————————————————————————–**

**c) Write a single-error correction code using even parity. Underline the parity bits.**

** Ans) Conside decimal number 1,**

** 0001 is the data to be transmitting.**

**Then we need 3 parity bits for detection(2**^{3} >= 4+3+1),

**P1 P2 D1 P3 D2 D3 D4**

**1 0 0 0 0 0 1**

**Using even parity hamming.**

**If data change into 0000 while transmitting,then**

**receiving end it detect and correct by following way,**

**actual data 100001**

**CorreptedData 1000000**

**XOR 0000001**

**So, last bit error detected and correct it .**

**————————————————————————————————————————–**

**d) What is the code distance of your code?**

**Ans) 2**

**Explanation:-**

**Distance-1=error detection**

**So,1 bit error=2-1**

**Eg:-**

**0001 data**

**00011 parity added message**

**00000 changed data**

**so there is 2 bit change , meand distance=2**

**———————————————————————————————————————-**

**16) A set of eight data bits is transmitted with the single-error correction code .Check error occured or**

** not**

**Ans)**

**a) 1 1 0 1 0 0 1 1 0 0 1 0 –>yes error occured**

**We transmit following,**

**11 0 1 1 0 01 0 1 1 0 0**

**1110 is the transmitting parity bit**

**but we get 1111 parity bit so correct 1 bit**

**it will get**

**1 1 0 1 0 0 1 1 0 0 0 0**

**——————————————————————————–**

**b)0 0 0 0 1 0 1 1 0 1 0 0 –>yes error occure**

**We transmit following,**

**11 0 1 1 0 01 0 1 1 0 0**

**1110 is the transmitting parity bit**

**but we get 0001 parity bit so correct 1 bit**

**we get**

**0 0 0 0 1 0 1 1 0 1 1 0**

**———————————————————————————————————————-**

**c) 1 0 1 1 0 0 1 0 0 1 0 0 —>error occure**

**We transmit following,**

**11 0 1 1 0 01 0 1 1 0 0**

**1110 is the transmitting parity bit**

**but we get 0001 parity bit so correct 1 bit**

**we get,**

**1 0 1 1 0 0 1 0 1 1 0 0**