moose-mousse - Electronic Moose
Electronic Moose

Helloooo! I am Moose! They/Them/He/Him I am a embedded software engineer with autism, depression and anxiaty ( Wooo! ). I post about... whatever I want... software things, mental health things... whatever I feel like Feel very wellcome to send me asks about... anything that strikes your fancy :3

266 posts

What Is Half-adder And Full-adder Combinational Circuits?

What is half-adder and full-adder combinational circuits?

So this question came up in the codeblr discord server, and I thought I would share my answer here too :3

First, a combinational circuit simply means a circuit where the outputs only depends on its input. ( combinational means "Combine" as in, combining the inputs to give some output )

It is a bit like a pure function. It is opposed to circuits like latches which remembers 1 bit. Their output depends on their inputs AND their state.

These circuits can be shown via their logic gates, or truth tables. I will explain using only words and the circuits, but you can look up the truth tablet for each of the circuits I talk about to help understand.

What Is Half-adder And Full-adder Combinational Circuits?

Ok, so an in the case of electronics is a circuit made with logic gates ( I... assume you know what they are... Otherwise ask and I can explain them too ) that adds 2 binary numbers, each which have only 1 character. 

So one number is 1 or 0

And the other number is 1 or 0

So the possible outputs are are 0, 1 and 2.

Since you can only express from 0 to 1 with one binary number, and 0 to 3 with 2, we need to output 2 binary numbers to give the answer. So the output is 2 binary numbers

00 = 0

01 = 1

10 = 2

11 = 3 // This can never happen with a half adder. The max possible result is 2

Each character will be represented with a wire, and a wire is a 0 if it is low voltage (usually ground, or 0 volts) and a 1 if it is high voltage (Voltage depends. Can be 5 volts, 3.3, 12  or something else. )

BUT if you only use half adders, you can ONLY add 2 single character binary numbers together. Never more.

If you want to add more together, you need a full adder. This takes 3 single character binary numbers, and adds them and outputs a single 2 character number.

This means it have 3 inputs and 2 outputs.

What Is Half-adder And Full-adder Combinational Circuits?

We have 2 outputs because we need to give a result that is 0, 1, 2 or 3

Same binary as before, except now we CAN get a 11 (which is 3)

And we can chain full adders together to count as many inputs as we want.

So why ever use a half adder? Well, every logic gate cirquit can be made of NAND (Not and) gates, so we usually compare complexity in how many NAND gates it would take to make a circuit. More NAND gates needed means the circuit is slower and more expensive to make.

A half adder takes 5 NAND gates to make

A full adder takes 9 NAND gates.

So only use a full adder if you need one.

Geeks for Geeks have a page for each of the most normal basic cirquits:

Half Adder in Digital Logic - GeeksforGeeks
GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, qu

I hope that made sense, and was useful :3

  • hydralisk98
    hydralisk98 reblogged this · 9 months ago
  • hydralisk98
    hydralisk98 liked this · 9 months ago
  • admitit
    admitit liked this · 1 year ago
  • sweetpoetrygladiator
    sweetpoetrygladiator liked this · 1 year ago
  • schlimedup
    schlimedup reblogged this · 1 year ago
  • schlimedup
    schlimedup liked this · 1 year ago
  • theguyrunningsouth
    theguyrunningsouth reblogged this · 1 year ago
  • theguyrunningsouth
    theguyrunningsouth liked this · 1 year ago
  • taperwolf
    taperwolf reblogged this · 1 year ago
  • taperwolf
    taperwolf liked this · 1 year ago
  • nounofrassilon
    nounofrassilon liked this · 1 year ago
  • moose-mousse
    moose-mousse liked this · 1 year ago
  • noctumsolis
    noctumsolis reblogged this · 1 year ago
  • ofairandbeauteousone
    ofairandbeauteousone liked this · 1 year ago
  • commodorez
    commodorez reblogged this · 1 year ago
  • it-becomes-so
    it-becomes-so liked this · 1 year ago
  • somniphobicfox
    somniphobicfox liked this · 1 year ago
  • doctorfurbenstein
    doctorfurbenstein liked this · 1 year ago
  • moose-mousse
    moose-mousse reblogged this · 1 year ago
  • illustrious-carbonic-eels
    illustrious-carbonic-eels liked this · 1 year ago
  • the-windup-official
    the-windup-official liked this · 1 year ago
  • blake447
    blake447 reblogged this · 1 year ago
  • memorias-de-una-computadora
    memorias-de-una-computadora reblogged this · 1 year ago
  • goldenspirits
    goldenspirits reblogged this · 1 year ago
  • goldenspirits
    goldenspirits liked this · 1 year ago
  • mbvisualarts
    mbvisualarts reblogged this · 1 year ago
  • mbvisualarts
    mbvisualarts liked this · 1 year ago
  • datamodel-of-disaster
    datamodel-of-disaster liked this · 1 year ago
  • unishine
    unishine liked this · 1 year ago
  • vez0k1
    vez0k1 reblogged this · 1 year ago
  • studywithvictory
    studywithvictory liked this · 1 year ago
  • arbiewebbjr
    arbiewebbjr liked this · 1 year ago
  • tired-goblin
    tired-goblin liked this · 1 year ago
  • cyberfolktale
    cyberfolktale liked this · 1 year ago
  • quietmarie
    quietmarie liked this · 1 year ago

More Posts from Moose-mousse

1 year ago

One of us! One of us!

Art By Me, Inspired By Tsuukochuo & Dachell_Art
Art By Me, Inspired By Tsuukochuo & Dachell_Art

Art by me, inspired by Tsuukochuo & dachell_Art

⟡ INTRODUCTION ⟡

Heya! I'm neospidey but you can call me neo ヾ(^∇^) I made this blog to share my journey as I learn to code. Hopefully, I'll find like-minded people and keep myself accountable.

I took a web dev course back in 2022 but my study technique was poor thus I quickly burned out. Now I'm trying to relearn html, css, php and javascript. If that sounds interesting, feel free to stick around ^-^

Disclaimer: I might post some art and other hobby related stuff every now and then.

⟡ ABOUT ⟡

I'm an autistic woman of many skills or rather... many hyperfixations, some of which I'm actually decent at (>▽<) The main one being art with gaming a close second! Here's a list of my other interest:

Juggling

Skateboarding

Reading (I'm currently reading Berserk and The Silmarillion)

D&D

Beekeeping

Music (some faves are TOOL, Crumb, Radiohead, MF DOOM and Death Grips)

Inspired by blogs like: @xiacodes, @dawncodes, @berry-codes, @zoeythebee


Tags :
1 year ago
So I Made A GUI For My Parents Campsite. They Wanted A GUI On Tablets, Or Maybe A PC Where They Could

So I made a GUI for my parents Campsite. They wanted a GUI on tablets, or maybe a PC where they could have costumers input the needed info from them.

I can make native GUI's on WIndows, Linux, Android but… this is not the smartest way to make 95% of programs.

You just write a website in HTML, CSS and Javascript, and have all the code in 1 file (You can easily write your own "compiler" that simply copies CSS or Javascript from many files into one file if you want to work with multiple files… And yes, you can write that in HTML and Javascript too)

Here I simply take in the values as strings, sanitize and treat them, and then save them in LocalStorage on the browser.

When you type "Excel" into the first textbox, it reveals 2 extra buttons to download all the data as a CVS file that my parents can open in Excel, and to clear the local storage so the GUI is ready for the next day.

Simple, safe, easy, and will work on any machine that have a browser… meaning them all.

Forget chefs kiss. Programmers KISS is what you want :p


Tags :
1 year ago

I look up the stupid printf argument format dozens a dozens of times every year, despite having coded C for almost a decade now...

me: has been coding for 6.5 years

also me:

Me: Has Been Coding For 6.5 Years

Tags :
1 year ago

Oooh! Oh! Oh!

Also!

If you do not do web development there are embedded systems. For those of us who like working close to the electronics and/or on small linux computers :3

If you enjoy developing and coding, there are several paths you can pursue:

Front-end development

Back-end development

Full-stack development

It's important to note that there is generally more competition in back-end development compared to front-end. Therefore, securing an internship in back-end development may be more challenging than in front-end.

However, if coding isn't your preference (which doesn't mean you shouldn't be in the field), there are alternative career options you can explore:

DevOps engineering : My next post will be about DevOps

Testing (consider obtaining the ISTQB certificate)

Management of tech projects

These options provide diverse opportunities within the IT industry.


Tags :
1 year ago

So I made an app for PROTO. Written in Kotlin and runs on Android.

Next, I want to upgrade it with a controller mode. It should work so so I simply plug a wired xbox controller into my phone with a USB OTG adaptor… and bam, the phone does all the complex wireless communication and is a battery. Meaning that besides the controller, you only need the app and… any phone. Which anyone is rather likely to have Done.

Now THAT is convenient!

( Warning, the rest of the post turned into... a few rants. ) Why Android? Well I dislike Android less than IOS

So it is it better to be crawling in front of the alter of "We are making the apocalypse happen" Google than "5 Chinese child workers died while you read this" Apple?

Not much…

I really should which over to a better open source Linux distribution… But I do not have the willpower to research which one... So on Android I stay.

Kotlin is meant to be "Java, but better/more modern/More functional programming style" (Everyone realized a few years back that the 100% Object oriented programming paradigme is stupid as hell. And we already knew that about the functional programming paradigme. The best is a mix of everything, each used when it is the best option.) And for the most part, it succeeds. Java/Kotlin compiles its code down to "bytecode", which is essentially assembler but for the Java virtual machine. The virtual machine then runs the program. Like how javascript have the browser run it instead of compiling it to the specific machine your want it to run on… It makes them easy to port…

Except in the case of Kotlin on Android... there is not a snowflakes chance in hell that you can take your entire codebase and just run it on another linux distribution, Windows or IOS…

So... you do it for the performance right? The upside of compiling directly to the machine is that it does not waste power on middle management layers… This is why C and C++ are so fast!

Except… Android is… Clunky… It relies on design ideas that require EVERY SINGLE PROGRAM AND APP ON YOUR PHONE to behave nicely (Lots of "This system only works if every single app uses it sparingly and do not screw each-other over" paradigms .). And many distributions from Motorola like mine for example comes with software YOUR ARE NOT ALLOWED TO UNINSTALL... meaning that software on your phone is ALWAYS behaving badly. Because not a single person actually owns an Android phone. You own a brick of electronics that is worthless without its OS, and google does not sell that to you or even gift it to you. You are renting it for free, forever. Same with Motorola which added a few extra modifications onto Googles Android and then gave it to me.

That way, google does not have to give any rights to its costumers. So I cannot completely control what my phone does. Because it is not my phone. It is Googles phone.

That I am allowed to use. By the good graces of our corporate god emperors

"Moose stares blankly into space trying to stop being permanently angry at hoe everyone is choosing to run the world"

… Ok that turned dark… Anywho. TLDR There is a better option for 95% of apps (Which is "A GUI that interfaces with a database") "Just write a single HTML document with internal CSS and Javascript" Usually simpler, MUCH easier and smaller… And now your app works on any computer with a browser. Meaning all of them…

I made a GUI for my parents recently that works exactly like that. Soo this post:

Electronic Moose
Tumblr
So I made a GUI for my parents Campsite. They wanted a GUI on tablets, or maybe a PC where they could have costumers input the needed info f

It was frankly a mistake of me to learn Kotlin… Even more so since It is a… awful language… Clearly good ideas then ruined by marketing department people yelling "SUPPORT EVERYTHING! AND USE ALL THE BUZZWORD TECHNOLOGY! Like… If your language FORCES you to use exceptions for normal runtime behavior "Stares at CancellationException"... dear god that is horrible...

Made EVEN WORSE by being a really complicated way to re-invent the GOTO expression… You know... The thing every programmer is taught will eat your feet if you ever think about using it because it is SO dangerous, and SO bad form to use it? Yeah. It is that, hidden is a COMPLEATLY WRONG WAY to use exceptions…

goodie… I swear to Christ, every page or two of my Kotlin notes have me ranting how I learned how something works, and that it is terrible... Blaaa. But anyway now that I know it, I try to keep it fresh in my mind and use it from time to time. Might as well. It IS possible to run certain things more effective than a web page, and you can work much more directly with the file system. It is... hard-ish to get a webpage to "load" a file automatically... But believe me, it is good that this is the case.

Anywho. How does the app work and what is the next version going to do?

PROTO is meant to be a platform I test OTHER systems on, so he is optimized for simplicity. So how you control him is sending a HTTP 1.1 message of type Text/Plain… (This is a VERY fancy sounding way of saying "A string" in network speak). The string is 6 comma separated numbers. Linear movement XYZ and angular movement XYZ.

The app is simply 5 buttons that each sends a HTTP PUT request with fixed values. Specifically 0.5/-0.5 meter/second linear (Drive back or forward) 0.2/-0.2 radians/second angular (Turn right or turn left) Or all 0 for stop

(Yes, I just formatted normal text as code to make it more readable... I think I might be more infected by programming so much than I thought...)

Aaaaaanywho. That must be enough ranting. Time to make the app


Tags :