The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Define a mask and write the appropriate masking operation for each of the situations described below.
(a) Copy the odd bits (bits 1,3, 5, . . . ,15) and place zeros in the even bit locations (bits 0, 2,4, . . . , 14) of a 16- bit, unsigned integer quantity represented by the variable v. Assume that bit 0 is the rightmost bit.
(6) Strip the most significant bit (the lef host bit) from an 8-bit character represented by the variable c. (Certain word processors use this bit to control the formatting of the text within a document. Stripping this bit, i.e., setting it to zero, can transform the word processor document into a text file consisting of ordinary ASCII characters.)
(c) Copy the odd bits (bits 1, 3,5, . . . , 15) and place one’s in the even bit locations (bits 0,2,4, . . . , 14) of a 16- bit, unsigned integer quantity represented by the variable v. Assume that bit 0 is the rightmost bit.
(b) Toggle (invert) the values of bits 1 and 6 of a 16-bit, unsigned integer quantity represented by the variable v, while preserving all of the remaining bits. Assign the new bit pattern to v. Assume that bit 0 is the rightmost bit.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------