RISC - V (RISC - Five)

 

RISC-V ISA:

Official RISC-V ISA manual: https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf

Very good ISA intro => https://www.allaboutcircuits.com/technical-articles/introductions-to-risc-v-instruction-set-understanding-this-open-instruction-set-architecture/

RISC-V ISA is extensible so that it can be used for very basic microcontrollers, and also for complex super computers. In order to figure out what extension of ISA we are working with, we have a naming convention.

RV[###][ab..yz] => RV means RISC-V arch, [###] indicates width of reg file and size of user addr space, it may be 32, 64 or 128 bits. [ab...yz] indicates the set of extensions supported by an implementaion.

Extensions supported are as below: Number of reg and their width depends on the extension.

  • I = Integer => This inst set is the only reqd extension in RISC-V, and defines 47 instructions.
  • M = Integer Multiplication and Division
  • G = General purpose which includes inst from I,M,A,F,D extensions
  • C = an alternative compressed 16 bit encoding for a special subset of existing inst.
  • A = Atomic extensions and many more std extension
  • Many non-std extensions allowed too, and denoted as Xext.

ex:

  • RV32I => Most basic RISC-V implementation. It's reg file is 32 bit, and supports Integer only.
  • RV64GCXext => 64 bit (G=general purpose IMAFDC, C=16 bit compressed inst) + a non std extension
  • RV32I/RV64I => they have 32 Int reg. F and D ext have 32 FP reg too. RV32E has only 16 integer reg for use in embedded devices.

RISC-V yields smallest code size for 32 and 64 bit processors compared to x86, ARM, MIPS, etc. RV32C or compressed version of ISA is the smallest code.

 

Reg File:

Reg: x0-x31. x0 is a "zero reg" hard wired to 0. NOTE: The ABI (application Binary i/f) names of the reg are different, and shown in link above.

Base Integer ISA (encoded in 32 bits) are for following:

  • Addition:
  • Subtraction:
  • Bitwise op:
  • Load/Store:
  • Jump:
  • Branch:

More inst:

  • AMO (atomic mem op) perform read-modify write in a single atomic op.
  • FENCE inst form a barrier. All inst preceeding FENCE must complete before proceeding. These are used t enforce program order.
  • CSR (ctl and Status reg) inst and ECALL (environment call inst) to change privilege modes.
    • MM has ~17 CSR. (ex: Misa(m/c ISA reg), mstatus(m/c status), etc)

Modes:

Modes are privilege levels supported by RISC-V. We have 3 modes.

  • Mode 3 or Machine mode (MM) is the highest privilege mode and the only required mode.
  • Mode 2=Hypervisor,
  • Mode 1=Supervisor,
  • Mode 0=User/application.

These modes are also put as levels which correspond to diff combo of modes -  level 1 to level 4.

 

RISC-V also supports Virtual memory allowing for sophisticated mem mgmt and OS ctl (as Linux, etc). This requires an S-Mode implementation - Sv32, Sv39, Sv48 corresponding to 32 bit, 39 bit and 48 bit virtual mem. Physical mem protection is also supported for up to 16 regions, where we can restrict access to those regions.

RISC-V supports interrupts. CSR reg used to enable/disable specific interrupts or to see the status of any interrupt.

 

 

 

 

 

 

Prepositions and Adverbs:

Prepositions are words that show the relationship between elements in a sentence. Simply put, prepositions are connector words. These connectors customarily tie a noun to an idea.  An example of this is in the sentence, “I went to the store.” “To” connects the location of “store” to where the person went. So,"to" is a preposition. A preposition takes an object. If there’s a noun following the term, it usually indicates the term is a preposition

Adverbs are similar to Prepositions, but slightly different. An adverb doesn’t take an object. Adverbs such as these usually appear at the end of the clause or sentence. 

ex: "He ran down the stairs", then down is a preposition, since the noun "stairs" appears after the term "down". If it's "He ran down", then "down" is an adverb since there's no object.

ex: Maria looked out the window. => Here out is a preposition, since object "window" is present. If it's "We’re going out at 7:00 pm tonight", then out is an adverb, as there's no object, It's just the time that's mentioned.

Spanish language has same word for different prepositions, so it's very hard to learn how to use them properly. They are the ones that are mastered the last, but are used the most. Many words are both adverbs and prepositions, and their usage with or without an object determines what they classify as. We'll go over basic prepositions and adverbs (they are not strictly one or the other but general guidance).

Prepositions:

Often a preposition is a short word such as but, for, and, etc.

  • pero => but (i.e I want to go, but I can't => quiero ir, pero no puedo). Also used as "yet", which is similar to "but". ex: yet I failed => but still I failed.
  • para => for
  • por => By
  • y (pronounced spanish "e" or English "a") => and. i.e Balls and balloons.
  • o => OR. Do you like tennis or Football? => ¿te/le gusta el tenis o el fútbol? =>  gustar is explained under -ar verb separately.

 

Adverbs:

Often adverbs are words like If, then, with, to, etc.

  • Si => If. This is w/o an accent. If we put an accent on i, then Sí (with an accent on i) => yes.
  • con => with.
  • a => To (we saw this in verb section and personal "a" section).
    • al => To the. If "a" is followed by el (masculine noun), we combine them to form short cut +el = al. See in "ir verb" section.
  • en => in/on. It can mean either "in", "on","at", "inside", etc and meaning is clear from context. estar form is used as it's location.
    • in: estoy en casa => I'm in the house
    • on: el libro está en la mesa => the book is on the table. If we used "la caja", then en will mean "in" as most likely "it's in the box".
  • de => of or from. Most commonly used meaning of "de" is of, but sometimes it means "from" too. There are many other meanings too depending on context.
    • of:
      • el presidente de Francia => the president of France
      • to the right/left of => a la derecha de / a la izquierda de
    • from:
      • Soy de Londres. I’m from London.
    • del => of the / from the. If de is followed by el (i.e masculine noun), we combine the 2 words to form "de+el=del". el is used as "the" for masculine nouns, so del only appears with masculine nouns (of + the + masculine noun). If we have feminine nouns that require la, then de + la remain separate.
      • Es la casa del padre de mi amigo => It is the house of my friend’s father (the father of my friend). Since it's "de el padre", it becomes "del padre"
      • Es la casa de la madre de mi amigo. Here, because madre is feminine, you use la, (don't combine de and la)
      • He is from the market => él es del mercado. If it was "from the class", then it's "de la clase"
  • sobre => about. ex: I want a book about cars => quiero un libro sobre autos
  • adentro / afuera => inside / outside
    • ex: ¿Dónde están las llaves? => Where are the Keys? Response would be "The keys are inside / outside" => las llaves están adentro / afuera (we can drop "las llaves" as is generally donw with I, you in spanish). So simply "están adentro / afuera"
  • cada/todo/todos=> each/all (see in "numbers" section)
  • tambíén => Also. as well, too
    • ex: él también tienes mucho talento => He too has a lot of talent.
  • entonces => then or so. As we use in common sentences. ex: Then what? => ¿entonces qué?

 


 

Prepositional Pronouns (PP):

When Pronouns are used after a preposition, they are known as prepositional pronouns (PP). Ex: This is for him. Here "him" has preposition "for", so it's a PP, and has to follow the table below. The transformation table for PP remains same for all entries of 3x2 table, except for 1st and 2nd person singular. There is one other rule with "con" => 1st and 2nd table entries change to combine con with PP. It becomes con+PP+go all in 1 word. See below.

 NOTE: him, her, them, us, etc should have followed DOP/IOP tables shown in Pronouns section. But instead since they have prepositions, they follow the below table.

 Pronouns singular (only 1st/2nd person change) plural ( all same as pronoun table)
Me /us => First person

mí => with accent. It also means "my" (see in pronoun section). Regular pronoun table has "yo" here.

with me => conmigo (we don't use "con mí" => special rule)

ex: Do you want to go with me? => ¿Quieres ir conmigo?

nosotros / nosotras => us

ex: This is for us => esto es para nosotros (us should have been "nos" as per DOP/IOP table, but instead we use pronoun for "we" => us and we have same transform)

You / You all  => Second person

ti => Regular pronoun table has "tú" here.

with me => contigo (we don't use "con ti" => special rule)

ex: Yes, I do want to go with you => Sí, quiero ir contigo.

vosotros / vosotras => You all

 

Him, her, it / them=> Third person

él /ella => him, her, it

ex: life is easy for her => la vida es fácil para ella.

ex: This gift is from him => este regalo es de él. (No del as it's él and NOT el)

ellos / ellas => Them

ex: They go with them => ellos van con ellos (them should have been los/las based on IOP/DOP table, but instead we use pronoun for "they".

 

 

Bones and Muscles:

Very imp part of our body are bones and muscles.

Bones:

Childhood and adolescence is the period of greatest bone density. All through your life, your body is continually removing old bone and replacing it with fresh bone. This process is called remodeling. Until 30, we tend to gain more bone mass than we lose. After 30, reverse happens. Up until about age 40, all the bone removed is replaced. After age 40, however, less bone is replaced and we start losing bone mass. Once bones start getting brittle and weak, it can lead to disease like rickets and osteoporosis. it's very difficult to make them stronger again, so try to keep bones healthy in your young age. According to the American Academy of Orthopaedic Surgeons (AAOS), 50 percent of Americans over age 50 have weak bones. 80% of them are women, as their bones are smaller and thinner. Additionally, levels of the female hormone estrogen, which helps protect bones, declines sharply after menopause. No wonder, for women, we see so many more bone issues. So for women, protecting bones is even more important.

Bone mass vs Bone density: Bone weight is about 15% of body weight, but that is not a useful metric. Bone density is more important metric for bone health. The DXA (central dual-energy X-ray absorptiometry) test measures your bone density compared to the bone density of a healthy young adult. Your score on the test is called your T-score. The normal healthy adult gets a T-Score of 0. If your T-score is more than one point (called a standard deviation) below 0, you may have weak bones, explains NIH. If your T score is between -1 and -2.5, you have low bone mass. If your score is -2.5 or lower, you have osteoporosis. Women are more prone to osteoporosis because of smaller bones.

Article from John Hopkins about bone maintenance => https://www.hopkinsmedicine.org/health/conditions-and-diseases/osteoporosis/osteoporosis-what-you-need-to-know-as-you-age

Few tips to keep bones healthy:

  • Calcium + Vitamin D: Your bones store roughly 98 percent of the calcium in your body. Because calcium is important for many body functions, if you don't have enough, your body will take calcium out of your bone bank, thus weakening them. Take 1g of Calcium everyday (For people over 50, 1.2g is recommended). Foods like cheese, yougurt, milk, salmon, etc contain calcium. While calcium is the biggest bone-health player, your body also relies on Vitamin D, Vitamin K, Potassium and Magnesium to build strong bones. Vitamin D is needed to help calcium get absorbed into body. There are 2 sources of getting Vit D - one thru exposure to UV rays from sun, and other thru food. Very few foods (eggs, Orange Juice, cereals, salmon, etc) contain enough Vit D, so Vit D supplements are needed. Recommended amount is 1000 IU of Vit D every day. Upper safe limit is 4000 IU per day. 1000 IU is 25 microgram (0.025 mg or 25 mcg) of Vit D, so very small amount of Vit D is enough. Vit D helps with many other functions of our body too (helps build your immune system), so make sure you get enough. Indians have very low levels of Vit D, so make sure you take supplements with 2000-5000 IU. I've myself taken 50,000 IU Vit D supplements (once a week, prescribed by Doctor), as Vit D levels have been too low. That barely got me into the acceptable range. Recommended range for Vit D is b/w 30-100 in your blood test.
    • For vegetarians, 1 glass of milk (250ml) has 25% calcium and 25% Vit D requirement of an adult. Here milk is fortified with Vit D (sold in USA). Even Orange Juice come with fortified Calcium and Vit D, so take those.
    • Vit D: Vit D exists in 2 forms - Vit D2 and Vit D3. Vitamin D2, or ergocalciferol, is found in fungi (mushrooms) and yeasts. Vitamin D3, or cholecalciferol (koli-kal-ciferol) is produced by the body via sunlight (Thru sunlight, the skin converts 7-Dehydrocholesterol into Vit D3) or ingested via food. Liver converts this cholecalciferol into 25-Hydroxycholecalciferol, which the kidneys then convert into 1, 25-DiHydroxycholecalciferol. This is also called calcitriol, which is the active form of Vit D. This moves into the small intestine, which then increases the number of calcium binding proteins. That helps with calcium absorption. Vit D3 is more important. When we say Vit D, we always mean Vit D3. Video on Vit D: https://www.youtube.com/watch?v=iLDYbSX5MLA
  • Exercise: Higher bone density is needed for stronger bones, and exercise helps with that. Lifting weights, running, biking all make your bones stronger.

 

Cartilage: This is a covering over the bone, seen in the thigh bone, where it meets the shin bone.

 

Muscles:

Few terms for diff kinds of muscles:

  • Ligaments => Soft tissue structures that connect bone to bone.
  • Tendons => These are much like Ligaments except that they connect bones to muscles. Muscles move the bones by pulling on the Tendons

 

Knee Basics:

Knees are the most important part of the bone structure and the most fragile. They are the first ones to give up due to old age, or plain wear and tear. It's important to consider knees in it's own section.

Knee bone basics: https://www.youtube.com/watch?v=_q-Jxj5sT0g

Meniscus tear: This is one the common tears that you can get very easily. Once you get it, it's very difficult to fix by itself. Doctors will want to do surgery, but don't fall for it.

Good advice on this link: https://kingbrand.com/Meniscus-Information.php?msclkid=fb0a365fb9521e7e41d353ed1bb57eaa

 Parts of Knee:

  • Meniscus: These are C shaped shock absorbers between the thigh bone and shin bone, and help with the impact when the 2 bones aremoving aginst each other. It's made of cartilage, and hence has a poor blood supply. A tear in meniscus can cause lockup, giving out, pain when squatting, lifting weight, etc. Lock up or giving out is when you cannot straigten your knee completely while running. The torn parts of meniscus get in between the 2 bones, and cause pain. A Surgery is done to shave off these lose parts, and get them out of your body, which relives the pain. But then you have less of miniscus left, which may increase your chances of getting  arthritis down the line.

 

Knee Surgery: This is one of the most violent surgeries that is done in a human body. IHA has good video on this: https://www.youtube.com/watch?v=2mqZnJJNU5s

 

ACL Repair: Good animation on repair of ACL => https://www.youtube.com/watch?v=Xsq0sQp6DwU

 

 

Kidneys:

Kidneys filter the blood of harmful elements along with water in the blood, and gets all of them out of the body by storing them in the bladder.

There are 2 kidneys on 2 sides below all other parts in abdomen, just at the last ribs of abdomen. One kidney is slightly lower than the other.

Link (short general video) => https://www.youtube.com/watch?v=TrU5g19Om0k

 

 

 

Human Anatomy

Here we'll learn about all major parts of human body, and how they work in tandem.There are different sections dedicated to different parts of human body as digestion, respiration,brain, muscles, etc.

There's this book on human anatomy that's very good book to get started. => https://www.amazon.com/Complete-Human-Body-Alice-Roberts/dp/0744073677

It's on sale and can be had for a dollar or two. Few deals:

You can also find it for free here: https://archive.org/details/AliceRobertsTheCompleteHumanBodyDKPublishing2016/page/n62/mode/2up

You can download each page individually as jpeg image, so no need to pay anyone anything. Enjoy free education !! (It has since been taken down, so need to move to other free resources)

Bunch of Free Resources on Human Body:

 

 In following sub sections, you will find devoted material on body parts as:

  • Brain
  • Heart
  • Lungs
  • Kidneys
  • Liver
  • Human cells
  • Blood
  • Hormones
  • Bones/Muscles