• German Language vlog 14 – Clues for Masculine Nouns

    Male Person

    der Großvater		-	Grandfather 
    der Onkel		-	Uncle 
    der Vater		-	Father	 
    der Cousin		-	Cousin 
    der Bruder		-	Brother 
    der Sohn		-	Son 
    der Ehemann		-	Husband 
    der Schwiegervater	-	father-in-law 
    der Schwiegersohn	-	son in law 
    der Schwager		-	brother in law 
    der Neffe		-	Nephew 
    der Enkel		-	Grandson 
    der Mann		-	Man 
    der Erwachsene		-	Adult 
    der Junge		-	Boy 
    der Stiefvater		-	Stepfather 
    der Stiefsohn		-	Stepson 
    der Partner		-	Partner 

    Weekdays – Wochentage

    Monday		-	der Montag	
    Tuesday		-	der Dienstag	
    Wednesday	-	der Mittwoch	
    Thursday	-	der Donnerstag	
    Friday		-	der Freitag	
    Saturday	-	der Samstag
    Sunday		-	der Sonntag
    

    German Seasons – Deutsche Jahreszeiten

    der Winter	-	winter
    der Frühling	-	spring
    der Sommer	-	Summer
    der Herbest	-	Autumn

    Makes of Cars
    der BMW – BMW
    der Jaguar – Jaguar

    Alcoholic Drinks
    der Whisky – Whisky
    der Wien – Wine

    ‘Beer’ is an exception and neuter = das Beer

  • German Language vlog 13 – Nouns and Gender

    German Nouns have grammatical gender and not biological gender. What this means is that sometimes a person can be of different gender even if it biological gender is actually something else.

    example: A young girl is biologically female. So her gender would be feminine.
    But in german it is das Mädchen. Here das indicates neuter gender, which comes from the grammatical gender.

    So it is always best to learn a noun with its article and gender. It will help in the long term.

    The article change depending on the use of the noun in Accusative, Nominative, Dative, or Genative.

    The article ‘the’ will always be ‘die’ for all the plural nouns.

  • Merge Sort is bad for Embedded System

    Merge sort is good if your system has plenty of memory to accommodate the temporary array.

    Embedded systems have very limited memory and it is often fixed.

    If the system has some other function that also runs concurrently. Then that memory also gets shortened.

    Merge sort is good for a bigger system like the personal computer and business computer which have the bigger memory in which all the temporary array can reside.

    The advantage of merge sort is that it is stable.

    Since it takes a lot of space it is not useful for an embedded system, as they have a very small memory sometimes it is just KilloByte.
    example:
    ATmega328p = 2KB SRAM
    ATtiny85 = 512B SRAM

    Code for STM32F429ZIT6

    This code redirects the printf statements towards the asynchronous UART.
    As the size of input array for merge sort increases the space required to store temporary element increases, which eventually leads to stalling of the program.
    /* USER CODE BEGIN Header */
    /**
      ******************************************************************************
      * @file           : main.c
      * @brief          : Main program body
      ******************************************************************************
      * @attention
      *
      * Copyright (c) 2023 STMicroelectronics.
      * All rights reserved.
      *
      * This software is licensed under terms that can be found in the LICENSE file
      * in the root directory of this software component.
      * If no LICENSE file comes with this software, it is provided AS-IS.
      *
      ******************************************************************************
      */
    /* USER CODE END Header */
    /* Includes ------------------------------------------------------------------*/
    #include "main.h"
    
    /* Private includes ----------------------------------------------------------*/
    /* USER CODE BEGIN Includes */
    #include "stdio.h"
    #include "stdlib.h"
    /* USER CODE END Includes */
    
    /* Private typedef -----------------------------------------------------------*/
    /* USER CODE BEGIN PTD */
    
    /* USER CODE END PTD */
    
    /* Private define ------------------------------------------------------------*/
    /* USER CODE BEGIN PD */
    /* USER CODE END PD */
    
    /* Private macro -------------------------------------------------------------*/
    /* USER CODE BEGIN PM */
    
    /* USER CODE END PM */
    
    /* Private variables ---------------------------------------------------------*/
    UART_HandleTypeDef huart1;
    
    /* USER CODE BEGIN PV */
    
    /* USER CODE END PV */
    
    /* Private function prototypes -----------------------------------------------*/
    void SystemClock_Config(void);
    static void MX_GPIO_Init(void);
    static void MX_USART1_UART_Init(void);
    /* USER CODE BEGIN PFP */
    
    /* USER CODE END PFP */
    
    /* Private user code ---------------------------------------------------------*/
    /* USER CODE BEGIN 0 */
    /*
    * Function Name: _write
    * Function Description: Redirect the printf() statement towards the UART using the HAL_UART_Transmit
    Author: Abhay
    
    */
    int _write(int fd, char* ptr, int len) {
        HAL_UART_Transmit(&huart1, (uint8_t *) ptr, len, HAL_MAX_DELAY);
     //   HAL_UART_Transmit(&huart1, ptr, len, Timeout)
        return len;
    }
    
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
    	int i, j, k;
    	int n1 = m - l + 1;
    	int n2 = r - m;
    
    	/* create temp arrays */
    	int L[n1], R[n2];
    
    	/* Copy data to temp arrays L[] and R[] */
    	for (i = 0; i < n1; i++)
    		L[i] = arr[l + i];
    	for (j = 0; j < n2; j++)
    		R[j] = arr[m + 1 + j];
    
    	/* Merge the temp arrays back into arr[l..r]*/
    	i = 0; // Initial index of first subarray
    	j = 0; // Initial index of second subarray
    	k = l; // Initial index of merged subarray
    	while (i < n1 && j < n2) {
    		if (L[i] <= R[j]) {
    			arr[k] = L[i];
    			i++;
    		}
    		else {
    			arr[k] = R[j];
    			j++;
    		}
    		k++;
    	}
    
    	/* Copy the remaining elements of L[], if there
    	are any */
    	while (i < n1) {
    		arr[k] = L[i];
    		i++;
    		k++;
    	}
    
    	/* Copy the remaining elements of R[], if there
    	are any */
    	while (j < n2) {
    		arr[k] = R[j];
    		j++;
    		k++;
    	}
    }
    
    /* l is for left index and r is right index of the
    sub-array of arr to be sorted */
    void mergeSort(int arr[], int l, int r)
    {
    	if (l < r) {
    		// Same as (l+r)/2, but avoids overflow for
    		// large l and h
    		int m = l + (r - l) / 2;
    
    		// Sort first and second halves
    		mergeSort(arr, l, m);
    		mergeSort(arr, m + 1, r);
    
    		merge(arr, l, m, r);
    	}
    }
    
    /* UTILITY FUNCTIONS */
    /* Function to print an array */
    void printArray(int A[], int size)
    {
    	int i;
    	for (i = 0; i < size; i++)
    		printf("%d ", A[i]);
    	printf("\n");
    }
    
    /* USER CODE END 0 */
    
    /**
      * @brief  The application entry point.
      * @retval int
      */
    int main(void)
    {
      /* USER CODE BEGIN 1 */
    
      /* USER CODE END 1 */
    
      /* MCU Configuration--------------------------------------------------------*/
    
      /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
      HAL_Init();
    
      /* USER CODE BEGIN Init */
    
      /* USER CODE END Init */
    
      /* Configure the system clock */
      SystemClock_Config();
    
      /* USER CODE BEGIN SysInit */
    
      /* USER CODE END SysInit */
    
      /* Initialize all configured peripherals */
      MX_GPIO_Init();
      MX_USART1_UART_Init();
      /* USER CODE BEGIN 2 */
      int arr[] = { 12, 11, 13, 5, 6, 7,12};
            int arr_size = sizeof(arr) / sizeof(arr[0]);
    
    //        for( int temp=0; temp<1023;temp++){
    //  	arr[temp] = rand()*1000;
    //  }
            printf("Given array is \n");
            printArray(arr, arr_size);
    
            mergeSort(arr, 0, arr_size - 1);
    
            printf("\nSorted array is \n");
            printArray(arr, arr_size);
         //   return 0;
      /* USER CODE END 2 */
    
      /* Infinite loop */
      /* USER CODE BEGIN WHILE */
      while (1)
      {
        /* USER CODE END WHILE */
    
        /* USER CODE BEGIN 3 */
      }
      /* USER CODE END 3 */
    }
    
    /**
      * @brief System Clock Configuration
      * @retval None
      */
    void SystemClock_Config(void)
    {
      RCC_OscInitTypeDef RCC_OscInitStruct = {0};
      RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
    
      /** Configure the main internal regulator output voltage
      */
      __HAL_RCC_PWR_CLK_ENABLE();
      __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
    
      /** Initializes the RCC Oscillators according to the specified parameters
      * in the RCC_OscInitTypeDef structure.
      */
      RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
      RCC_OscInitStruct.HSIState = RCC_HSI_ON;
      RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
      RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
      if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
      {
        Error_Handler();
      }
    
      /** Initializes the CPU, AHB and APB buses clocks
      */
      RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                                  |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
      RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
      RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
      RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
      RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
    
      if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
      {
        Error_Handler();
      }
    }
    
    /**
      * @brief USART1 Initialization Function
      * @param None
      * @retval None
      */
    static void MX_USART1_UART_Init(void)
    {
    
      /* USER CODE BEGIN USART1_Init 0 */
    
      /* USER CODE END USART1_Init 0 */
    
      /* USER CODE BEGIN USART1_Init 1 */
    
      /* USER CODE END USART1_Init 1 */
      huart1.Instance = USART1;
      huart1.Init.BaudRate = 115200;
      huart1.Init.WordLength = UART_WORDLENGTH_8B;
      huart1.Init.StopBits = UART_STOPBITS_1;
      huart1.Init.Parity = UART_PARITY_NONE;
      huart1.Init.Mode = UART_MODE_TX_RX;
      huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
      huart1.Init.OverSampling = UART_OVERSAMPLING_16;
      if (HAL_UART_Init(&huart1) != HAL_OK)
      {
        Error_Handler();
      }
      /* USER CODE BEGIN USART1_Init 2 */
    
      /* USER CODE END USART1_Init 2 */
    
    }
    
    /**
      * @brief GPIO Initialization Function
      * @param None
      * @retval None
      */
    static void MX_GPIO_Init(void)
    {
      GPIO_InitTypeDef GPIO_InitStruct = {0};
    
      /* GPIO Ports Clock Enable */
      __HAL_RCC_GPIOA_CLK_ENABLE();
      __HAL_RCC_GPIOG_CLK_ENABLE();
    
      /*Configure GPIO pin Output Level */
      HAL_GPIO_WritePin(GPIOG, ledg_Pin|ledr_Pin, GPIO_PIN_RESET);
    
      /*Configure GPIO pins : ledg_Pin ledr_Pin */
      GPIO_InitStruct.Pin = ledg_Pin|ledr_Pin;
      GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
      GPIO_InitStruct.Pull = GPIO_NOPULL;
      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
      HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
    
    }
    
    /* USER CODE BEGIN 4 */
    
    /* USER CODE END 4 */
    
    /**
      * @brief  This function is executed in case of error occurrence.
      * @retval None
      */
    void Error_Handler(void)
    {
      /* USER CODE BEGIN Error_Handler_Debug */
      /* User can add his own implementation to report the HAL error return state */
      __disable_irq();
      while (1)
      {
      }
      /* USER CODE END Error_Handler_Debug */
    }
    
    #ifdef  USE_FULL_ASSERT
    /**
      * @brief  Reports the name of the source file and the source line number
      *         where the assert_param error has occurred.
      * @param  file: pointer to the source file name
      * @param  line: assert_param error line source number
      * @retval None
      */
    void assert_failed(uint8_t *file, uint32_t line)
    {
      /* USER CODE BEGIN 6 */
      /* User can add his own implementation to report the file name and line number,
         ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
      /* USER CODE END 6 */
    }
    #endif /* USE_FULL_ASSERT */
    
  • German Language vlog 12 – Questions

    Question WordsExamples
    Wer?
    Why?
    Frage 1: Wer bist du?
    Antwort: Ich bin Abhay.

    Frage 2: Wer sind Sie?
    Antwort: Ich hieße Parker.
    Was?
    What?
    Frage 1: Was machst du?
    Antwort: Ich lese ein Buch. (I am reading a Book.)
    Wo?
    Where?
    Frage 1: Wo ist Einstein?
    Antwort 1: Er ist im kindergarten.(He is in the Kindergarten)
    Antwort 2: Er ist in der Schule. (He is at the school.)
    Woher?
    Where … from?
    Frage 1: woher kommen sie?
    Antwort: Ich komme aus New Delhi.
    Wohin?
    Where … to?
    Frage 1: Wohin gehst du?
    Antwort: Zum Frisör
    Wann?
    When?
    Wann treffen wir uns? – When do we meet?
    Wann geht der Flug? – When does the plane leave?
    Wann beginnt das Konzert? – When does the concert start?
    Wann hast du Geburtstag? – When is your birthday? [informal]
    Warum?
    Why?
    Frage: Warum ist der Sonne gelb?
    Wie?
    How?
    Frage: Wie alt bist du?
    Antwort: Ich bin neun jahre alt.
    Wie viel?
    How much?
    Frage: Wie viel kostet die wurst?
    Wie viele?
    How many?
    Frage: wie viele finger sind in einer hand?
    Wie oft?
    How often?
    Frage: Wie oft spielst du?
  • German Language vlog 11 – Ordinal Numbers

    Ordinal Numbers are called ‘Ordnungszahlen’ in German.

    Ordinal Numbers are first, second, third, and so on in English.

    In german, there are few rules to make them. But they are easy to understand and once you get to practice you can easily understand them.

    Note: The spelling of ‘1’ and ‘3’ are different as they are irregular.

    Beispiel

    Fünfte
    Fifth

    Frage: Was ist zehnte in Englisch Ziffer?
    Antwort:
    Zehnte gleich Tenth in Englisch.

  • German Language vlog 10 – Fraction Numbers

    In this video, you will learn about German Fraction Numbers or Deutsch Bruchzahlen.

    For example,
    1/2 = ein halb
    1 1/3 = eins ein Drittel (one and one third)
    2 4/5 = zwei vier Fünftel (two and four fifth)
    5/6 = fünf sechstel (five sixth)

    Frage: Was ist acht zehntel in Dezimalzahl?
    Antwort:
    acht zehntel ist 8/10
    8/10 = 0.8
    0,8 = null komma acht
    0.8 = null punkt acht

    Frage: Was ist sechsundzwanzig drittel zehntel in Dezimalzahl?
    Antwort:
    sechsundzwanzig drittel ist 26/3
    26/3 = 12,0
    12,0 = zwölf komma null
    12.0 = zwölf punkt null

  • German Language vlog 9 – Decimal Numbers

    Deutsch Dezimal Zahlen
    German Decimal Numbers

    Beispiel

    Frage: Was ist eins punkt sieben plus drei?
    Antwort:
    eins punkt sieben = 1.7
    oder
    eins komma siben = 1,7

    drei = 3

    1.7 + 3 = 4.7
    eins punkt sieben gleich vier punkt sieben

    Frage: Was ist dreiundvierzig punkt acht minus zwei?
    Antwort:
    dreiundvierzig ist 43
    zwei ist 2

    43 – 2 = 41
    41 ist einsundvierzig

  • German Language vlog 8 – Basic Numbers

    These are the basic numbers that are used in the german language.

    In this video, I have shown the whole numbers which are positive and integers.

    The way german write their number is totally different from the english world.

    For example / Beispiel

    In English –
    21: twenty-one.
    11: eleven
    12: twelve
    13: thirteen

    in German –
    21 is Zweiundzwanzig
    11 is elf
    12 is zwölf
    13 is dreizehn

    Only by practicing you can tell the subtle changes in their spelling.

    The very core of arithmetics is Addition and Subtraction.
    Addition is “die Addition” in German.
    And Subtraction is “die Subtraktion” in German.

    Beispiel

    Frage: Was ist zwei plus drei?
    Antwort:
    2 + 3 = 5
    Zwei plus drei gleich fünf.

    Frage: Was ist fünf plus dreiundsiebzig?
    Antwort:
    5 + 73 = 78
    fünf plus dreiundsiebzig gleich achtundsiebzig.

    Frage: Was ist sechzig plus fünfhundertacht?
    Antwort:
    60 + 508 = 568
    fünfhundertacht plus sechzig gleich fünfhundertachtundsechzig.

    Frage: Was ist sechsundzwanzig plus fünfundsiebzig?
    Antwort:
    26 + 75 = 101
    es ist gleich hunderteins.

    Frage: Was ist sechs minus eins
    Antwort:
    6 – 1 = 5
    Sechs minus eins gleich fünf.

    Frage: Was ist acht minus drei?
    Antwort:
    8 – 3 = 5
    acht minus drei gleich fünf.

  • German Language vlog 7 – Imperatives ( Commands or Instructions)

    There are four imperative forms in German.

    Singular ( du and Sie )

    Plural ( ihr and Sie)

    In formal imperative, you write Sie after the infinitive form of the verb.
    Both the singular formal and plural formal imperative is written in the same way.

    du and ihr are different.

    Beispiel

    Trinke Wasser!
    Drink water!

    Seh Fern
    Watch TV

    öffne die Flasche
    Open the bottle

    machen sie bitte die tür zu


    Handwritten Notes

  • German Language vlog 6 – Separable Verbs

    Separable verbs are very tricky as they have to be memorized. You also have to take care of the correct ending of the infinitive when you separate the verb.

    Beispiel

    The meeting takes place on Monday.
    Das Treffen findet am Montag statt.

    When doe thee train depart?
    Wann fahrt der Zug ab.

    When does the train arrive?
    Wann kommt der Zug an.

    I get at 6’o clock.
    Ich stehe um sechs Uhr auf.

    Handwritten Notes