Question: use matlab or octave to code 2. (Bits) Computers don't store numbers in base 10, they use base 2. In base 2, we use the

use matlab or octave to code
2. (Bits) Computers don't store numbers in base 10, they use base 2. In base 2, we use the term "bit" as a short form for "binary digit". In binary, the bits will now be named the "ones bit", the "twos bit, the "fours bit", and so on. For example, the number 13, is 13 = (1)(8) + (1)(4) + (O)(2) + (1)(1) = (1101)2- all_bits.m Script: Input variables: number which is a sungle number between 0 and 15 Output variables: ones_bit, twos_bit, fours_bit, and eights_bit computed s the indi- vidual bits in the binary representation of the number A sample case is: 13; >> number = >> all bits ones_bit = 1 twos_bit = 0 fours_bit = 1 eights_bit = 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
