GATE CSE 2023 Q60: Value of 10#011 under a binary-fraction translation scheme
- Compiler Design
- 2 marks
- NAT
- No negative marking
Question
Consider the syntax directed translation given by the following grammar and semantic rules. Here , , and are non-terminals. is the starting non-terminal, and #, and are lexical tokens corresponding to input letters “#”, “0” and “1”, respectively. denotes the synthesized attribute (a numeric value) associated with a non-terminal . and denote occurrences of and on the right hand side of a production, respectively. For the tokens and , and .
The value computed by the translation scheme for the input string
is _______. (Rounded off to three decimal places)
Try it: numerical answer: type the value
Show answer and explanation
Answer: 2.374 to 2.376 (official GATE 2023 final answer key)
Concept used: The scheme reads a binary number with an integer part and a fractional part.
First step: Evaluate for '10' (binary integer) and for '011' from the rightmost bit inward.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2023 CS question paper and final answer key, organised by IIT Kanpur. Question paper · Answer key
More Compiler Design PYQs
- 2026 Session 1 · Q27Classify errors in three C string declarations
- 2026 Session 1 · Q28True statements about LL(1) parsing
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG
- 2026 Session 1 · Q53Compare two SDDs for type declarations
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string
- 2026 Session 2 · Q41Shift-reduce conflicts in the LR(0) table of a grammar