---
title: "Convert (17)₁₀ to Gray"
subject: "Digital Logic"
chapter: 1
key: "semester_3/digital_logic:convert-17-gray"
source: https://www.bctengineer.com/q/semester_3/digital_logic/convert-17-gray
site: BCT Engineering
---

# Convert (17)₁₀ to Gray

Digital Logic · Chapter 1: Introduction

- Asked in: 2076 Chaitra, 1.5 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/digital_logic/convert-17-gray
- Whole chapter: https://www.bctengineer.com/md/semester_3/digital_logic/chapter-1

## Question

Convert (17)₁₀ = (?)gray.

## Short answer

17₁₀ = 10001₂. Gray code: keep MSB 1, then XOR each adjacent binary bit: 1⊕0=1, 0⊕0=0, 0⊕0=0, 0⊕1=1 → 11001 (Gray).

## Answer

First convert decimal to binary, then to Gray code: the MSB stays the same and each next Gray bit is the XOR of two adjacent binary bits, $G_i = B_{i+1} \oplus B_i$.

**Step 1:** $17_{10} = 16 + 1 = (10001)_2$

**Step 2: Binary to Gray**

| Binary bits | Operation | Gray bit |
|---|---|---|
| 1 | copy MSB | 1 |
| 1, 0 | $1 \oplus 0$ | 1 |
| 0, 0 | $0 \oplus 0$ | 0 |
| 0, 0 | $0 \oplus 0$ | 0 |
| 0, 1 | $0 \oplus 1$ | 1 |

**Answer:** $(17)_{10} = (10001)_2 = (11001)_{gray}$

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How is decimal 17 converted to Gray?
   A. Directly by subtracting 3
   B. First to binary, then to Gray
   C. Add 1 to each bit
   D. Take the 2's complement
   Answer: B. Gray is derived from the binary value. (Key point: Route)

2. What is (17)10 in binary?
   A. 10001
   B. 10101
   C. 11001
   D. 01111
   Answer: A. 16 + 1 = 10001. (Key point: Binary)

3. How is each Gray bit obtained from binary?
   A. XOR of two adjacent binary bits; MSB copied
   B. AND of adjacent bits
   C. Complement of each bit
   D. Sum of all bits
   Answer: A. G_i = B_(i+1) XOR B_i. (Key point: Gray rule)

4. What is 17 in Gray code?
   A. 10001
   B. 11000
   C. 01110
   D. 11001
   Answer: D. 1, 1^0=1, 0^0=0, 0^0=0, 0^1=1. (Key point: Result)

## Related in Digital Logic

- [Convert (17)excess-3 to BCD](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-17-excess3-bcd) — Digital Logic, chapter 1
- [Gray vs binary code, convert (10110)₂ to Gray](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Agray-vs-binary-convert-10110) — Digital Logic, chapter 1
- [Convert (101001001)₂ to Gray](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-binary-to-gray-101001001) — Digital Logic, chapter 1
- [Convert (19)₁₀ to Gray](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-19-gray) — Digital Logic, chapter 1
- [Convert (10101)gray to decimal](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-gray-10101-decimal) — Digital Logic, chapter 1
- [Convert (110111)gray to binary](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-gray-110111-binary) — Digital Logic, chapter 1
