Try creating your own little man computer branching algorithm that solves a common computing problem. If you want to be really adventurous, try creating a loop or recursion of some sort. This will be a topic I will cover in a future video and you will get to check you work against it!
@roxannelai78034 жыл бұрын
I watched the video about iteration, branching and labels and wanted to try my hand at the countdown problem. I am not sure that this is the right way to go about it (the video only had around 6 steps), but I tried my best! So, here is my try at the countdown problem with both the assembler and LMC instructions: 00 INP /901 01 STA A /312 02 loop LDA A /512 03 OUT /902 04 SUB one /113 05 STA A /312 06 BRZ endIt /708 07 BR(A) loop /602 08 endIt LDA A /512 09 SUB A /112 10 OUT /902 11 HLT /000 12 A DAT 13 one DAT
@CodingCoach4 жыл бұрын
Roxanne this looks very good! Couple of things I noticed: 1. Lines 4 and 9 use the SUB assembler but have an add op code! (this was an error I made in this video that i noted in with text on the screen, 1 = add, 2 = sub) so i believe both lines should have had a 213 and 212 respectively. Running the program with an input value of 3 I get: 3 2 1 0
@roxannelai15144 жыл бұрын
@@CodingCoach Thank you! And okay got it, I must have missed the text on the screen. It is definitely not the most concise, but as you said, at least it works!
@davegraham75504 жыл бұрын
LMC should be used everywhere in the world.
@davegraham75504 жыл бұрын
Teaching to ngabere language speakers in Panama today. Mostly learner in one session.
@CodingCoach4 жыл бұрын
LMC is an amazing way to break down how the ISA works, I love using it as a starting point! Enjoy the lesson!
@davegraham75504 жыл бұрын
Works well going between any languages. Digital and language learning are a natural match.
@davegraham75504 жыл бұрын
From as soon as people are learning to speak and write..
@davegraham75504 жыл бұрын
All people can understand computing, a small set of simple actions done at very high speed. Programming via programming languages can come later and is far less fundamental than understanding the digital engine analagious in many ways to a combustion engine. A repeating cycle and that is all it can do.
@erim14343 жыл бұрын
This was very helpful, thank you!
@CodingCoach3 жыл бұрын
Glad it was helpful!
@jaygobeasty41624 жыл бұрын
great video, can't fid anything like this on the internet
@CodingCoach4 жыл бұрын
glad you liked it!
@nataliejohn3763 жыл бұрын
Shouldn't step 5 be 213 bcs it's substract? But u put 113. Am I misunderstanding this or did u do a mistake there?
@CodingCoach3 жыл бұрын
yes you are correct! I had added a note in the description and I think I added subtitles although I understand most people don't have the on. KZbin does not seem to let me edit the video after I've posted it at least not when I did it.
@nataliejohn3763 жыл бұрын
@@CodingCoach aaa I see. But overall, the video made me understand more about LMC. Online classes make it really hard for me to understand so I really am grateful to you 😁
@alessandramancas4162 жыл бұрын
Thank you this was so helpful!!
@pranavsuthar9233 жыл бұрын
ahh that window reflectiom :)
@vedbhanushali6083 жыл бұрын
thank you sir.
@CodingCoach3 жыл бұрын
Most welcome
@gailenkelly54813 жыл бұрын
How would you just output a number, say 1, using a branch for only if the first input is greater than the second number? Can you specify the output instead of BRP or BRZ?
@CodingCoach3 жыл бұрын
If you input 2 numbers and then subtract the first from the second and the result is negative you know the first number was bigger then the second (remember you have to store the first) so.. 00 INP // lets say input is 5 01 STA 10 02 INP // lets say input is 3 03 SUB 10 // would be 3 - 5 (since 3 is still in the acc) so choosing a BRP would work for your question since anything 0 or greater would indicate a larger second input. If it does not branch the first number was bigger something like.. 04 BRP 07 05 LDA 11 // we will put a 1 here 06 OUT 07 HLT 10 DAT 11 001 I think if understood your question correctly this would work.
@gailenkelly54813 жыл бұрын
@@CodingCoach Ok, I assumed what you just wrote except I got stuck after the branch instruction. Thank you!
@nadirberrachedi43473 жыл бұрын
Hi there i am trying to create a program which displays the highest number. I tried to follow your tutorial but got a bit stuck. the program is always outputing the first number. Do you know what the problem is? INP STA num1 INP STA num2 SUB num1 BRP pos pos LDA num2 LDA num1 OUT BRA exit exit HLT num1 DAT num2 DAT