I am having a time with these problems:
X=1100110000110011
Y=0000111100001010
1) what would I get in binary representation for X<<5?
2) what is the two's complement of negative Y (-Y)?
3) If X is an int variable, what do we know about the value of X&X?
a. It is always equal to X.
b. It is always greater than 1.
c. It is always equal to zero.
d. It is always equal to 1.
4 1274
What are you having trouble with? Did you try them? What did you get?
HI.,..
i cant understand Q1 fully, but if you wanna all binary values for x < 5 then
Q1: x=000 , 001 , 010 , 011 , 100
Q2: to get the 2's complementer first u reverse all bits 0s to 1s and all 1s to 0s and then additional the result by 1
Y=0000111100001010
1's Complementer =1111000011110101
2's Complementer =0000000000000001
and then add each 2 bits ------------------------------
= xxxxxxxxxxxxxxxx
the result is the 2's complementer for Y or -Y by 2's complementer
Q3: answer is choice A
try to check behind me i cant exactly rememmber all things, but i think it will right answer..
by the way is that home work? :D
GOOD LUCK..
Q1 isn't asking about the < operator, but the bitshift operator <<, which I believe moves the entire set of bits to the left, creating 0s at the end. For instance, - X = 0100 1101
-
X << 2
-
(X is now 0001 0011 0100)
Of course, I could be wrong.
Q1 isn't asking about the < operator, but the bitshift operator <<, which I believe moves the entire set of bits to the left, creating 0s at the end. For instance, - X = 0100 1101
-
X << 2
-
(X is now 0001 0011 0100)
Of course, I could be wrong.
hey..no man i think that you fully right, its SHL operator
Many Thanx
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dan Stromberg |
last post by:
I've written up a page about how to convert native binary data to
another platform's native binary data, as I did some fortran data
conversions for a client.
The programs and documentation are...
|
by: Steven T. Hatton |
last post by:
§27.4.2.1.4 Type ios_base::openmode
Says this about the std::ios::binary openmode flag:
*binary*: perform input and output in binary mode (as opposed to text mode)
And that is basically _all_ it...
|
by: Tanuki |
last post by:
Hi All:
I encounter a programming problem recently. I need to read a binary
file. I need to translate the binary data into useful information. I
have the format at hand, like 1st byte = ID,...
|
by: vim |
last post by:
hello everybody
Plz tell the differance between binary file and ascii
file...............
Thanks
in advance
vim
|
by: Daz |
last post by:
Hi everyone!
I am very new to casting and converting, so much in fact then when I
think I have it figured out, something proves me wrong. I was wondering
if there is any logic in 'what types can...
|
by: Harlin Seritt |
last post by:
Hi...
I would like to take a string like 'supercalifragilisticexpialidocius'
and write it to a file in binary forms -- this way a user cannot read
the string in case they were try to open in...
|
by: masood.iqbal |
last post by:
Hi,
Kindly excuse my novice question. In all the literature on ifstream
that I have seen, nowhere have I read what happens if you try to read
a binary file using the ">>" operator. I ran into...
|
by: raphfrk |
last post by:
This program should copy one file onto the other. It works if I
compile it with gcc to a cygwin program. However, if I compile it
with the -mno-cygwin option, it doesn't work (this targets native...
|
by: Bill Cunningham |
last post by:
I was wondering if someone could look this file over for me. It compiles
correctly and prints the number 2 so I know fscanf is working. I am reading
a text file and converting the text data...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |