How to decode this binary message? [closed] - binary

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
When my best friend wrote his yearbook message to me in 5-bit binary, I didn't the slightest idea of how to translate it. Can anyone please tell me what he could have possibly said?
00001 01010 01101 00000 10001 11000 01010 10010 00111 00000 10001 00011.
-01001 00000 01010 00100 01100 00111 00000 00110 10010!

5 bit bcd with a=0 gives what initially looks like gibberish, though with a bit of playing around, you can pull out the phrase BINARY IS HARD. -JAKE MHAGS!, where MHAGS is presumably a misspelling of Jake's last name. Note that the educated guessing involved fixing numerous typos, inserting spaces, etc.
B K N A R Y K S H A R D J A K E M H A G S
Now in answer form instead of as a comment.

Related

I don't understand why my 8.6 tcl version does understand a for loop like this: "for{set i 0}{$i<10}{incr i}{ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 days ago.
Improve this question
I am using the tclsh interpreter and the Synopsis Primetime shell. Both are not supporting that kind of loop. is there something that I am missing here?
Thanks a lot
I am trying to perform a very standard for loop
I think you just a syntax error. This works for me:
for {set x 0} {$x<10} {incr x} {
puts "x is $x"
}
Outputs:
x is 0
x is 1
x is 2
x is 3
x is 4
x is 5
x is 6
x is 7
x is 8
x is 9

Convert a negative number with a fraction in 2's complement [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 3 years ago.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I want to convert number -0.25. So 0.25 (for 4 bit int and 4 bit frac) equals to:
0000_0100
For negative number -1 answer is
1111
But what is -0.25? How can I convert this negative number with a fraction in 2's complement?
To answer this question, I need to clarify that the numbers are represented in a fixed-point. Almost all logic nowadays uses two's complement. Therefore, in the two's complement version negative numbers are considered for example:
signed 4'b1100 = -4 (-1*2^3 + 1*2^2 + 0*2^1 + 0*2^0).
Number for example 0.25 in fixed-point binary will be represented:
8'b0000_0100 (int 4 bit is zeros and frac 4 bit -> 0*2^-1 + 1*2^-2 + 0*2^-3 + 0*2^-4).
Other way to calculate can be multiply the number to integer find negative and then divide this number (remember, that multiplication on 2 is shift to the right, and division on 2 is shift to the left).
For my example -0.25 would be as follows:
-0.25*2*2= -1.
-1 = 4'b1111.
shift 2*2 to left = 4'b11_11 = -0.25.
Or we can calculate: -1*2^1 + 1*2^0 + 0*2^-1 + 1*2^-2.
1 in MSB is signed bit. We must remember this when operate with signed logic.

Octave - How to plot an "infinite"(= Defining the function on [0:35916] for me) sawtooth function [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I know how to plot a sawtooth function (thanks to another forum) but only on the domain [0:10] thanks to the following code which is actually working :
t=0:0.04:10;
A=1;
T=1;
rho= mod(t * A / T, A);
plot(t,rho)
A=the amplitude, T=the period,t=the time interval.
The problem is that I need the same function on the domain [0:35916] but when I try to adapt this code to do so (eg by extending the time interval), I get an error and I don't understand why.
error:
plt2vv: vector lengths must match error: called from plt>plt2vv at line 487 column 5 plt>plt2 at line 246 column 14 plt at line 113 column 17 plot at line 222 column 10
Simply modifying the original upper limit of your interval from 10 to 35916 should do the trick:
t=0:0.04:35916;
A=1;
T=1;
rho= mod(t * A / T, A);
plot(t,rho)
The code above yields the following image:
Of course it is up to you to adjust A and T to suit your needs.

How do I convert 234.35 into Binary? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I need to convert the above into Binary. I'm at a loss here.
Can you include full information on how you got the answer too?.
Step by step would be great!
First, convert the integral part which is 11101010. Next, you build the decimal part. If demonstrated informally, it is something like:
0.1 is one half, but 0.35 is less than that, so the first binary digit is zero -> .0 (0.35)
0.01 is one quarter, and 0.35 is greater than that, so then follows one. 0.35 minus one quarter is decimal 0.1 -> .01 (0.35 - 0.25 = 0.1)
0.001 is one eighth, and decimal 0.1 is less than that, so again zero -> .010 (0.1)
Next steps are: .0101 (0.1 - 0.0625 = 0.0375); .01011 (0.0375 - 0.03125 = 0.00625); then follow two zeroes, and we can probably cut it here.
So, the answer is 11101010.010110... As the original number has decimal part of 7/20, it becomes infinite when converted to binary.

function in Haskell that can solve an equation [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to write a function in Haskell that can solve the following problem(physic_problem):
What is the height (in a whole number of meters) of the shortest building that you could drop a ball from such that it would take at least 5 seconds to hit the ground?
The equation can be found here http://en.wikipedia.org/wiki/Equations_for_a_falling_body
I really tried hard on this and i need help!
Thank you so much!
Consider for instance this,
g :: Double
g = 9.81
dist :: Double -> Double
dist t = g * t^2 / 2
Then,
> dist 5
122.625
Additionally you may want to create a module out of the equations in that Wiki.
Update
For delivering an integral value consider for example
dist' :: (Integral a) => Double -> a
dist' t = ceiling $ g * t^2 / 2
Here we use ceiling (upper bound), yet note Converting to Integral for other rounding functions. Hence,
> dist' 5
123