Las variables contienen un valor representado por un código numérico o alfanumérico. El sistema de numeración que usamos las personas es un sistema decimal. Esto quiere decir que existen 10 símbolos diferentes los cuales son combinados para construir cualquier número. Estos 10 símbolos son los número del 0 al 9. Por ejemplo para representar el número 121 en decimal se hace la siguiente operación:
1×102+2×101+1×100=100+20+1=121
En el ejemplo se puede observar que para que para obtener el número se toma el símbolo de cada posición (que puede ser cualquiera entre 0 y 9), se multiplica por la base (10 para sistema decimal por sus 10 símbolos) elevada a la posición en que se encuentre el símbolo comenzando desde el número 0. En otras palabras el símbolo en la posición cero se multiplica por 1 (100 =1), el símbolo en la segunda posición se multiplica por 10 (101=10), el símbolo de la tercera posición se multiplica por 100 (102=100) y así sucesivamente.
Sistema de numeración binario
El sistema de numeración binario funciona de forma similar al sistema de numeración decimal, con la diferencia que en el sistema binario la cantidad de símbolos son dos, el 0 y el 1. Por ejemplo para representar el número 121 en binario se hace la siguiente operación:
1×26+1×25+1×24+1×23+0x22+0x21+1×20= 64+32+16+8+0+0+1=121
La representación del número 121 en binario es 1111001b. La “b” al final es para indicar que la representación está en binario y diferenciarlos de un millón ciento once mil uno en decimal. En este punto se pueden estar preguntando cómo se obtuvo el patrón de unos y ceros para la representación del 121 en binario, hay varias formas para hacer esto, una muy sencilla es ir colocando 1’s de izquierda a derecha progresivamente, si al colocar un 1 en determinada posición y el valor supera al valor buscado, entonces esa posición lleva un valor de cero. Para el ejemplo anterior si comenzamos con un 1 en la posición 7 el valor obtenido es 127 el cual es mayor que 121, por esa razón comenzamos con un 1 en la posición 6. La siguiente tabla resume el procedimiento
Posición | Suma acumulada | Valor en la posición |
6 | 2posición=26=64 | 1 |
5 | 64+32=96 | 1 |
4 | 96+16=112 | 1 |
3 | 112+8=120 | 1 |
2 | 120+4=124 > 121 | 0 |
1 | 120+2=122 >121 | 0 |
0 | 120+1=121 | 1 |
Numero de bits
A cada posición (o dígito) de un número binario también se le llama bit, en el caso del ejemplo anterior el número 121 es representado con 7 bits. El número de bit es importante por determina el rango de valores que puede tener un número binario, por ejemplo, un número de 8 bits puede tener un valor que va desde 0 hasta 255 (2n-1), donde n es el número de bits). Desde el punto de vista de la electrónica, el hecho de que cada dígito o bit tenga sólo dos valores es muy importante, esto le da una simplicidad a cada dígito que puede ser representado como un interruptor abierto o cerrado, o con un transistor en corte o saturación, o con un LED prendido o pagado entre otras opciones.
Códigos
La combinaciones de 1’s y 0’s también sirven para representar códigos, como por ejemplo el código ASCII. Por ejemplo el número 01111001b representa el número 121, representa la letra “y” en el código ASCII y representa el número 79 en código BCD entre otros.
Tipos de variables
La importancia de los números binarios en el uso de los PLC radica en el hecho que los microprocesadores con los cual se construyen realizan todos sus operaciones usando como argumentos variables binarias. Estas variables binarias puede ser de diferentes tipos, los más usados son: booleana o bit, enteros, punto flotante y caracteres o cadena de caracteres. Las variables enteras y de punto flotante son llamadas variables analógicas.
Variables Booleanas
También llamadas lógicas o de bit, son representaciones binarias de un solo bit o con un solo dígito, en tal sentido, sólo pueden tener los valores de 0 o 1, que normalmente son interpretados como falso o verdadero respectivamente.
Enteros
Son registros de memoria que pueden almacenar números de n bit, donde n, típicamente, es múltiplo de 2. Así podemos tener variables enteras de 4 bits, 8 bits, 16 bits, 32 bits y 64 bits. El número de bits, como se mencionó antes, determina el rango de los valores que puede tener la variable.
Cuando se representa números binarios, a veces se representas números positivos y el cero, a este código se le denomina binario puro; pero también se pueden representar valores negativos, positivos y el cero, a este código se le denomina binario en complemento a dos. Dependiendo del número de bits se le puede asignar un nombre al entero, por ejemplo un entero de 8 bit es también llamado byte. La siguiente tabla muestra el un resumen de numero de bit y su rango.
Numero de bits | Rango binario | Rango binario complemento a dos |
4 (nibble) | 0 a 15 | -8 a 7 |
8 (byte) | 0 a 255 | -128 a +127 |
16 | 0 a 65.535 | -32,768 a +32,767 |
32 | 0 a 4.294.967.295 | -2,147,483,648 a +2,147,483,647 |
64 | 0 a 18.446.744.073.709.551.615 | -9.223.372.036.854.775.808 a +9.223.372.036.854.775.807 |
Punto flotante
También llamadas reales, pueden contener número con decimales. La representación en punto flotante se hace con estándares como IEEE 754. Con este estándar y precisión simple se pueden representar número desde -1.17549449×10-38 hasta 3.40282346×1038.
Carácter
Un carácter es un símbolo de la tabla ASCII (letras, números, símbolos y caracteres de control) representado con 8 bits, a la concatenación de varios caracteres se le llama cadena de caracteres y se usan para formar palabra o frases.
Hey, thanks for the blog.Really thank you! Great.
I’d must examine with you here. Which isn’t one thing I normally do! I enjoy reading a submit that may make folks think. Also, thanks for permitting me to comment!
Really informative blog article.Really looking forward to read more. Fantastic.
Thanks a lot for the blog.Much thanks again. Will read on…
It is actually nearly impossible to come across well-qualified men or women on this matter, even though you appear like you be aware of which you’re indicating! Excellent
Enjoyed every bit of your article.Much thanks again. Awesome.
Great blog.Thanks Again. Fantastic.
I am so grateful for your blog post.Much thanks again. Really Cool.
buy prilosec generic – order generic prilosec 20mg buy tenormin
I loved your blog post.Really thank you! Fantastic.
This is a topic that is close to my heart… Take care! Where can I find the contact details for questions?
I think this is a real great article post.Thanks Again. Keep writing.
I am sure this article has touched all the internet visitors, its reallyreally pleasant post on building up new blog.
However, Leech Ninja is an efficient Premium link Generator, it supports NitroFlare, Keep2Share, and Uploaded.
Major thankies for the article.Really looking forward to read more. Really Great.
tamoxifen vs raloxifene nolvadex – tamoxifen for men
Hi there, yes this paragraph is genuinely fastidious and I have learnedlot of things from it concerning blogging. thanks.
This is one awesome blog article.Thanks Again. Want more.
Has anyone ever tried Valhalla eLiquid Eliquid?
Thank you for your blog post.Thanks Again. Cool.
ivermectin and covid 19 ivermectin horse wormer tractor supply
store locator lloyds pharmacy online pharmacy no scripts
This is the perfect blog for anybody who hopes to find out about this topic.You definitely put a brand new spi on atopic which has been discussed for decades.Wonderful stuff, just excellent!
Thanks, I have just been searching for info approximately this topic for a long time and yours is the greatest I’ve found out so far. But, what concerning the bottom line? Are you positive concerning the source?
Muchos Gracias for your blog article.Really thank you! Fantastic.
I was recommended this blog by way of my cousin. I am no longer sure whether this submit is written via him as no one else realize such special about my trouble. You’re amazing! Thank you!
Hi there! Do you use Twitter? I’d like to follow you if that would be okay. I’m absolutely enjoying your blog and look forward to new posts.
Very good blog article.Thanks Again. Fantastic.
Hi there! This post could not be written any better!Looking at this post reminds me of my previous roommate!He constantly kept talking about this. I’ll send this articleto him. Pretty sure he’ll have a great read. Many thanks for sharing!
Major thankies for the article.Really looking forward to read more. Cool.
Im thankful for the article.Much thanks again. Great.
I think this is a real great blog post.Thanks Again. Will read on…
Muchos Gracias for your article.Much thanks again. Fantastic.
Wow that was unusual. I just wrote an very long comment but after I clicked submit mycomment didn’t appear. Grrrr… well I’m not writing all that over again. Regardless, just wanted to say great blog!
I cannot thank you enough for the blog article.Really thank you! Want more.
A round of applause for your article.Much thanks again.
This is one awesome article post.Really looking forward to read more. Fantastic.
Im obliged for the article. Cool.
Major thankies for the blog article. Want more.
I really liked your blog. Really Cool.
Appreciate you sharing, great blog post.Really thank you! Really Great.
Appreciate you sharing, great blog article.Much thanks again. Fantastic.
purchase cenforce generic – generic aralen oral metformin
There is definately a great deal to find out aboutthis subject. I really like all of the points you made.
Hello i am kavin, its my first occasion to commentinganywhere, when i read this article i thought i could also create comment due to this goodparagraph.Feel free to visit my blog post … ac rentals
I will immediately seize your rss feed as I can not in finding youremail subscription link or e-newsletter service.Do you have any? Please allow me know in orderthat I may just subscribe. Thanks.
Muchos Gracias for your blog post.Thanks Again. Keep writing.
Hello my family member! I want to say that this post is amazing, nice written and comewith almost all significant infos. I wouldlike to see extra posts like this .
Im thankful for the blog article. Really Cool.
Aw, this was an extremely nice post. Takingthe time and actual effort to generate a really good article… but what can I say… I hesitate a whole lotand never manage to get nearly anything done.
I’d really like to be a part of onlinecommunity where I can get advice from other experienced people that share the same interest.
Major thanks for the article post.Really looking forward to read more. Will read on…
A big thank you for your blog post.Really looking forward to read more.
Im obliged for the post.Thanks Again. Cool.
Im grateful for the blog post.Thanks Again. Awesome.
Great, thanks for sharing this blog post.Really looking forward to read more. Cool.
generic tadalafil 5mg – sildenafil pills viagra 100mg brand
Thanks for the blog. Fantastic.
Im obliged for the article post.Thanks Again. Will read on…
I loved your blog post.Thanks Again. Awesome.
tizanidine uk – purchase hydrochlorothiazide pill purchase microzide pill
I really liked your article post. Will read on…
Thanks-a-mundo for the post.Thanks Again. Will read on…
I am so grateful for your blog post.Really thank you! Really Cool.
Thank you ever so for you article post.Much thanks again. Great.
Thanks a lot for the blog post.Thanks Again. Cool.
Really enjoyed this article post. Want more.
buy semaglutide 14mg generic – order levitra 20mg sale purchase cyproheptadine pill
I truly appreciate this post.Thanks Again.
I appreciate you sharing this article post.Really thank you! Want more.
Excellent way of describing, and nice piece of writing to obtain facts about my presentation subject matter, which i am going to present in institution of higher education.
stromectol ebay – fda ivermectin ivermectin 1
Thank you ever so for you article.Really looking forward to read more. Great.
Hey, thanks for the blog. Really Great.
I am so grateful for your blog post. Fantastic.
I value the article. Want more.
Im grateful for the article post.Thanks Again. Much obliged.
Very good blog.Really looking forward to read more.
Thank you ever so for you article.Really looking forward to read more. Cool.
buy clavulanate sale – buy cymbalta for sale buy cymbalta online cheap
What’s up mates, its fantastic paragraph about teachingand fullyexplained, keep it up all the time.
order neurontin 100mg for sale – anafranil 25mg generic buy generic sporanox
Some times its a pain in the ass to read what people wrote but this web site is rattling user friendly! .
What’s up, its fastidious post about media print, we all understand media is a wonderful sourceof data.
Looking forward to reading more. Great article.Really looking forward to read more. Keep writing.
Enjoyed every bit of your article post.Thanks Again. Want more.
Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say fantastic blog!
Thank you ever so for you blog.Really thank you!
order prednisolone 40mg without prescription – buy azipro 250mg pills generic prometrium
Major thanks for the article.Really looking forward to read more. Awesome.
Howdy! This post couldn’t be written any better!Reading this post reminds me of my good old room mate! He always kept talking about this.I will forward this post to him. Fairly certain he will have a good read.Thanks for sharing!
buy azithromycin 250mg – cheap tinidazole order nebivolol 20mg online cheap
chloroquine otc hydroxychloroquine update today hsq medical abbreviation
I’ll right away clutch your rss as I can’t find your e-mail subscription link or newsletter service. Do you’ve any? Please let me recognize so that I may subscribe. Thanks.
I like what you guys are usually up too. Such clever work and exposure!Keep up the excellent works guys I’ve included you guys toour blogroll.
What’s Hot On MediaKombat: Video – Famous Dex – Crazy me(shot by @cadencampise)
Its actually a great and helpful piece of information. I am happy that you just shared this useful information with us. Please keep us up to date like this. Thanks for sharing.
Bardzo interesujące informacje! Idealnie to, czego szukałem! przenośny generator tlenu.
I really liked your blog article.Thanks Again.
This is one awesome blog.Thanks Again. Fantastic.
These are genuinely wonderful ideas in aboutblogging. You have touched some pleasant things here. Any waykeep up wrinting.My blog – MaxBHB
Im obliged for the blog post.Much thanks again. Keep writing.
That is a very good tip especially to those fresh to the blogosphere. Short but very precise infoÖ Thanks for sharing this one. A must read post!
I like foregathering useful information, this post has gotme even more info!My blog post … Instant Keto Review
Hey, have you ever before wondered to write regarding Nintendo or PS handheld?
Looking forward to reading more. Great article.
Really appreciate you sharing this blog article.Really looking forward to read more.
Fantastic blog article. Cool.
I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visitmore often. Did you hire out a designer to createyour theme? Exceptional work!
Awesome blog.Really looking forward to read more. Awesome.
Very neat blog article.Thanks Again. Awesome.
Major thankies for the article post.Much thanks again. Keep writing.
This is one awesome blog post.Really thank you! Will read on…
wow, awesome article.Really looking forward to read more.
I really liked your article post.Much thanks again. Great.
Thanks for finally talking about >Qui Chế của Diễn Đàn Vijaya – ILIMOCHAMPA
fantastic issues altogether, you simply won a new reader.What could you suggest about your submit that you just made some days ago?Any positive?
These are genuinely great ideas in concerning blogging. You have touched some pleasant points here. Any way keep up wrinting.
It’s hard to come by knowledgeable people for this subject, however, you sound like you know what you’re talking about! Thanks
chloroquine otc hydroxychloroquine update today hsq medical abbreviation
I do not even know how I stopped up right here, but I believed this publish was once good. I don’t understand who you might be however definitely you’re going to a famous blogger for those who are not already 😉 Cheers!
Really enjoyed this post.Much thanks again. Want more.
amoxil online buy – amoxicillin tablets order ipratropium without prescription
F*ckin’ tremendous issues here. I am very glad to peer your article. Thank you so much and i am looking forward to contact you. Will you kindly drop me a e-mail?
purchase isotretinoin – buy zyvox 600 mg pills oral linezolid 600mg
ivermectin cost – carbamazepine 400mg price order carbamazepine pill
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. It extremely helps make reading your blog significantly easier.
A powerful share, I just given this onto a colleague who was doing a little bit evaluation on this. And he in truth bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the treat! However yeah Thnkx for spending the time to debate this, I feel strongly about it and love studying more on this topic. If possible, as you grow to be experience, would you mind updating your blog with extra details? It is extremely useful for me. Big thumb up for this blog put up!
Hello there, I found your blog via Google while looking for a related topic, your site came up, it looks good. I have bookmarked it in my google bookmarks.
I conceive this website holds some real superb information for everyone : D.
It’s really a great and useful piece of information. I am glad that you simply shared this helpful information with us. Please stay us informed like this. Thanks for sharing.
I always was interested in this subject and stock still am, thanks for putting up.