edited by
624 views
0 votes
0 votes

Consider the following grammar with corresponding synthesized attributes:
F → ⋅L {F.val = L.val}
L → LB {L.len = L.len + 1} {L.val = L.val+2 ^(-L.len)

× B.val}
L → B {L.len = 1, L.val = B.val/2}
B → 0 {B.val = 0}
B → 1 {B.val = 1}
If “F.val” gives the value of the binary fraction generated by F in above grammar then, the value of F.val on input {0.110} is _______. (Upto 3 decimal places)

 

 

Solution : 

 

Doubt : 

B.val = 0 ( red) 

then how 0.875 ( yellow ) ?

wont it be : 

0.75 + 2^-3 * 0 = 0.75 ?

 

 

edited by

Please log in or register to answer this question.

Related questions

2 votes
2 votes
2 answers
1
HeadShot asked Jan 5, 2019
605 views
Doubt: ( Even if we take compliment , its wont satisfy it )