2.81 Generate Bits
★★
Problem:
Write C expressions to generate the bit patterns that follow, where a^k represents k repetitions of symbol a. Assume a w-bit data type. Your code may contain references to parameters j
and k
, representing the values of j and k, but not a parameter representing w.
A. 1^{w-k}0{k}
B. 0^{w-k-j} 1^k 0^j
Code:
Last updated