• Register
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177
  • Questions
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Unanswered
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Tags
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Categories
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Users
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Exams Taken
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580
  • Exam List
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 580

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

CO-Grand Test -Q3


Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177
+1 vote

In a certain implementation of strings, characters are 8 bits long and words are 36 bits long. Characters are packed into double words so that no space is lost. How many words of memory does a k-character string require? (If the string does not occupy an integral number of double words, enough binary zeros are appended to reach the next single word boundary.)

(A). \lfloor 2k/9 \rfloor

(B). \lfloor k/9 \rfloor

(C). 2 \lceil k/9 \rceil

(D). \lceil 2k/9 \rceil

asked Jun 14, 2020 by gbeditor-2 (72,840 points)
reshown Jun 18, 2020 by gbeditor-2

1 Answer

0 votes
 
Best answer

Char size = 1 Byte

Word size = 36 bits

Double word size = 72 bits = 9 Bytes.

Characters are packed into double words so that no space is lost (because 36 bits is Not a multiple of 8 But 72 is a multiple of 8)

If the string does not occupy an integral number of double words, enough binary zeros are appended to reach the next single word boundary. This means that memory is word aligned i.e. Next string starts at the beginning of a new word. 

For example, if K=1 i.e. One character string S then we need to start next string from next word onwards and for this string S, we need to append zeroes to make it reach the next single word boundary. So, when K=1 then we need 1 word. 

So, for K=1, answer will be 1. Hence we can eliminate option A,B,C. So, answer is option D.


Option C would be true if the memory was "double word aligned". In that case, for K=1, we would need 2 words. 

answered Jun 18, 2020 by deepak-gatebook (226,240 points)
Answer:

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177
...