Convert decimal +47 and +31 to binary, using the
signed-2’s-complement representation and enough digits to
accommodate the numbers. Then perform the binary equivalent of
(+31)+(-47), (-31)+(+47), and (-31)+(-47). Convert the answers back
to decimal and verify that they are correct.
Binary
How is 00001001 (base 2) represented in 8-bit two’s complement
notation?
Convert 0.3828125 to binary with 4 bits to the right of the binary
point.
How is 00110100 (base 2) represented in 8-bit one's
complement.
(a) Convert the decimal numbers, 70 and -26 to binary in the
signed 2’s complement system. Make sure there are enough digits in
the results to be able to perform arithmetic operations with these
two numbers.
(b) Perform in the signed 2’s complement system, (+70) +
(-26)
(c) Perform in the signed 2’s complement system, (-70) -
(-26)
(d) Perform in the signed 2’s complement system, (+70) +
(+26)
Write a program to convert the input numbers to another number
system.
1. Decimal to Binary
2. Binary to Decimal
3. Hexadecimal to Decimal
4. Decimal to Hexadecimal
5. Binary to Hexadecimal
6. Hexadecimal to Binary
The user will type in the input number as following:
Binary number : up to 8 bits
Hexadecimal number: up to 2 bytes
Decimal number: Less than 256
As a result, print out the output after the conversion with
their input numbers.
The program...
Salesperson
Years of Experience
Annual Sales ($1000s)
1
3
79
2
4
92
3
4
91
4
4
106
5
7
102
6
9
112
7
10
120
8
11
117
9
11
114
10
13
135
A sales manager collected data on annual sales for new customer
accounts and the number of years of experience for a sample of 10
salespersons. In the Microsoft Excel Online file below you will
find a sample of data on years of experience...
Modify the sum_thread.cpp program to compute sum = 1 + 1/2 + 1/3
+ 1/4 + … 1/n.
Let’s estimate natural using n = 20.
sum_thread.cpp
#include <chrono>
#include <iostream>
#include <mutex>
#include <random>
#include <utility>
#include <vector>
#include <thread>
using namespace std;
constexpr long long size= 1000000;
mutex myMutex;
void sumUp(unsigned long long& sum, const vector<int>& val,
unsigned long long beg, unsigned long long end){
long long localSum = 0;
for (auto it= beg; it < end; ++it){
localSum+=...
write a VBA code to convert an arbitrary positive binary
fractional number (0< number<1) to equivalent decimal number.
the code should acquire the binary fraction number in the
format"0.xxxxxx"from input box, then return the equivalent decimal
number in a message box. in the code, you may need to use VBA
function "mid(_,_,_)" to pick up a specific symbols or characters
from a string. you can use below conversion as benchmark to verify
and debug your code:
(0.1011)2 = (0.6875)10