Questions tagged [complement]

This tag is deprecated! Use more specific tags instead: For the binary representations of negative values in computer science, use tags [ones-complement] and [twos-complement]; For the bitwise complement operation, use [bitwise], or [regex-negation] for the use of complement patterns in regular expressions, or [bit-manipulation] for complementing said data.

This tag is deprecated! Please consider use of the following tags instead:

112 questions
0
votes
0 answers

How do I get the b-complement of 193 for b = 5?

So I am supposed to find the b-complement for 193 given that b = 5 and the number of digits allowed is n = 6. Now I think I am a bit confused regarding the b-complement in general. Is it that whenever b is odd, just like in the case we have here,…
FishyK
  • 121
  • 1
  • 7
0
votes
1 answer

Why complement of 0 is -1?

I was learning about bitwise operators and I learnt that complement of 0 is 1 and 1 is 0. But when I tried using ~0 on IDLE, it printed -1 and when i typed ~1 it gave -2..
0
votes
2 answers

Nine's complement with positive and negative decimal values Question

"If the number is positive, the nine's complement of the number is itself." I read this on a book named "Foundation of Computer Science", it said that the 9's complement of +234 is +234. Meanwhile, I looked for some turtorials on Youtube, however,…
0
votes
1 answer

Why is the 4s-complement of 412 (in decimal) 321210?

I used an online converter to convert 412 from decimal to base 4 (which is 12130), and then applied the r's complement formula to get its 4s complement (which is 21210). However, in 6bits, 21210 becomes 321210. When I try to convert it to decimal by…
0
votes
2 answers

Number base that makes 32 + 12 = 28 true?

I need to figure out what number base makes the expression 32 + 12 = 28 true. It looks like the second number is signed, I've tried converting to decimal and using 10's complement but haven't gotten an answer that makes sense.
0
votes
2 answers

Perl code for reverse complement of DNA sequence

I was trying to make a perl code to get the reverse complement of fasta sequences of DNA in a .fna file format. the sequence02C.fna file contains 100s of DNA sequences…
mashuk
  • 1
  • 1
0
votes
1 answer

14-Complement Multiplication between 9820 and 4823

I have to multiply 9820 and 4823 in 14- Complement. I know that the result is C7A75060, but I don't know how to get there. My problem occurs when I have to multiply 8 with 4823, I get 2893A, but I know it's wrong. How do I go with this?
Angela
  • 1
0
votes
0 answers

how mysql represent two's complement

I open the ibd file of MySQL InnoDB engine and confused by the number two's complement. For unsigned numbers, InnoDB used different representations. ibd binary data the code '80 05' is the PAGE_N_HEAP field of innodb page header, which represent…
Li.xz
  • 1
0
votes
1 answer

OWL Ontology: how to write a complement class definition?

The reasoner fails to classify classes under a class A that is defined as a complement of another class B. I have created a minimal OWL ontology example (based on the famous pizza example) in protege 5 to illustrate this problem. There are two pizza…
Ali
  • 183
  • 1
  • 7
0
votes
1 answer

Java Set Calculator: finding complement of sets

Im having trouble coding the complement of a set. For example if Set A (x)= {1, 2, 3, 4} and Set B (y)= {5, 2, 3, 8} The complement should be x-y={1,4} or y-x={5,8}. What should I change in this code to achieve this? for (i = 0; i < x; i++) { …
Dez Lo
  • 13
  • 2
0
votes
1 answer

What's the relationship between time complexity and complement?

What's the relationship between time complexity and complement? I do not understand what complement means to be used. I do not understand the sentence below. Approach #2 (Two-pass Hash Table) [Accepted] To improve our run time complexity, we need a…
user5740635
  • 117
  • 1
  • 8
0
votes
1 answer

How to find a complement to the following language?

How to find complement of L, L = {: M is a TM, which accepts some palindrome} What is the general rule to finding a complement? I am thinking in this particular case it would be L_bar = { : M_bar is a TM, which rejects any palindrome…
acagu
  • 23
  • 7
0
votes
1 answer

how to change 1 to 0 and 0 to 1 in binary(Python)

all. I want to change 1 to 0 and 0 to 1 in binary. for example, if binary is 00000110. I want to change it to 11111001. how to do that in python3? Best regards.
박형렬
  • 377
  • 1
  • 9
  • 24
0
votes
1 answer

Mantissa and Exponent - Negative number with decimal (beyond .5)

Here is my question. I am doing some work and am seeing two different answers. I was using a calculator (online) to check my answer and it is clashing with the answer I am supposed to get and I need to see which one is correct. The problem is:…
0
votes
1 answer

How 2's complement of -128 in Bit representation for 8 bit register is 1000 0000?

I have got a basic question for signed number representation in computer Q) As i have learned in a 8-bit representation the 7th bit ( count from 0-7) is always the sign bit and the remaining 0-6 bits are the magnitude of the number so in case of…