subject

Consider the storage of timestamp for time of the day in a system. the time stamp format needs/uses 5 bits for seconds/2, 6 bits for minutes and 5 bits for hours (stored as hours-minutes-seconds/2 from msb to lsb format). using these values, seconds/2 may take values from 0 to 31, minutes may take values from 0 to 63, and hours may take values from 0 to 31. in all the three cases, the extra unused values will never be actually used/taken. the total number of bits required to store all the three fields = 5+6+5 = 16. declare three structure-types for the timestamp. first uses unsigned char type for each of the three elements (seconds_by_2, minutes and hours), second uses unsigned int type for each of the three. the third type uses unsigned short and with bit fields specified for each element. print the size of each of the three struct types using sizeof operator for your architecture + compiler. explain the difference if any. which one is better, if any and why ?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
You know the right answer?
Consider the storage of timestamp for time of the day in a system. the time stamp format needs/uses...
Questions
question
Mathematics, 15.04.2020 23:58
question
Mathematics, 15.04.2020 23:58
Questions on the website: 13722367