Obtain Binary String: X + Y - Z | Binary Addition and Subtraction Rules

And for Q, it would be 11100 - 1001, but I'm not sure if you're supposed to do any kind of carrying over in binary subtraction.In summary, to obtain binary strings for P and Q, you would first use binary addition using the rules 0+0=0, 0+1=1, 1+0=1, and 1+1=10. Then, for Q, you would subtract the binary string for Z from the binary string for P, but it is unclear if carrying over should be used in binary subtraction.
  • #1
rclakmal
76
0
Obtain Binary String ?

Homework Statement



Given That X=10111 ,Y=101; Z=1001, obtain binary strings that represent P Q where
P=X+Y and Q=P-Z; state clearly each rule you apply .

Homework Equations





The Attempt at a Solution



Hey up to the extent which i know i did this as a normal binary addition and subtractions >then i got P=10010
and Q=1001 .But the problem is I am not sure that i have used any kind of rules here. or Have I ?? Or did i made a mistake in interpreting the problem .Can somebody help . this is all u got for that question ,i have included all the details.
 
Physics news on Phys.org
  • #2


Doing binary addition, I get a different result for P. The addition rules in binary are:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10

I can't think of any rules other than these.

So for X + Y you have
10111
+ 101
-----
11100
 
  • #3


Hi there,

To obtain the binary string P, you can use the binary addition rule. This rule states that when adding two binary numbers, you start from the right and work your way to the left, adding each column and carrying over any extra 1's.

So in this case, you would start with the rightmost column and add 1+1, which gives you 0 and a carryover of 1. Then you move to the next column and add 1+0+1, which gives you 0 and a carryover of 1 again. You continue this process until you have added all the columns and end up with P=10010.

To obtain the binary string Q, you can use the binary subtraction rule. This rule states that when subtracting two binary numbers, you start from the right and work your way to the left, subtracting each column and borrowing from the next column if necessary.

So in this case, you start with the rightmost column and subtract 1-1, which gives you 0. Then you move to the next column and subtract 1-0-1, which gives you 0 and you borrow 1 from the next column. You continue this process until you have subtracted all the columns and end up with Q=1001.

I hope this helps! Let me know if you have any further questions.
 

FAQ: Obtain Binary String: X + Y - Z | Binary Addition and Subtraction Rules

What is a binary string?

A binary string is a sequence of binary digits, either 0 or 1. It is commonly used in computer science as a way to represent data and instructions.

How do you obtain a binary string?

A binary string can be obtained by converting a decimal number to its binary representation using the binary number system. This can be done manually or with the use of a computer program.

What is the importance of binary strings in computer science?

Binary strings are essential in computer science because they form the basis of how computers store and process data. All data and instructions in a computer are represented as binary strings, allowing the computer to manipulate and interpret them.

Can binary strings be converted to other number systems?

Yes, binary strings can be converted to other number systems such as decimal, hexadecimal, and octal. This is useful for translating between different data formats and for performing mathematical operations.

Are there any limitations to binary strings?

Binary strings have a limited range of representation, which means they can only represent a finite set of numbers. This can result in errors and loss of precision when working with very large or very small numbers.

Similar threads

Replies
13
Views
2K
Replies
2
Views
1K
Replies
5
Views
902
Replies
2
Views
2K
Replies
11
Views
3K
Back
Top